Bug 22386: Define patron variable when matchign on extended attributes
authorNick Clemens <nick@bywatersolutions.com>
Thu, 21 Feb 2019 14:30:22 +0000 (14:30 +0000)
committerroot <root@f1ebe1bec408>
Fri, 22 Feb 2019 13:06:04 +0000 (13:06 +0000)
For all other methods we define a patron object and check the userid,
we just need to define the $patron here

To test:
0 - Apply unit test patch alone
1 - prove t/db_dependent/Koha/Patrons/Import.t
2 - It dies
3 - Apply this patch
4 - repeat tests
5 - It passes!

Signed-off-by: Devlyn Courtier <dcourtier@hccc.edu>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/Patrons/Import.pm

index 8311126..fe63b95 100644 (file)
@@ -176,6 +176,7 @@ sub import_patrons {
                     if ( $attr->{code} eq $matchpoint and $attr->{value} ne '' ) {
                         my @borrowernumbers = $matchpoint_attr_type->get_patrons( $attr->{value} );
                         $borrowernumber = $borrowernumbers[0] if scalar(@borrowernumbers) == 1;
+                        $patron = Koha::Patrons->find( $borrowernumber );
                         last;
                     }
                 }