Bug 20443: Fix Patrons/Import.t

->get_patrons has been removed but not replaced!

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-27 15:49:36 +01:00 committed by Martin Renvoize
parent 7e1be8d385
commit 6bb806ddf4
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
2 changed files with 8 additions and 3 deletions

View File

@ -174,8 +174,14 @@ sub import_patrons {
elsif ($extended) {
if ( defined($matchpoint_attr_type) ) {
foreach my $attr (@$patron_attributes) {
if ( $attr->{code} eq $matchpoint and $attr->{value} ne '' ) {
my @borrowernumbers = $matchpoint_attr_type->get_patrons( $attr->{value} );
if ( $attr->{code} eq $matchpoint and $attr->{attribute} ne '' ) {
my @borrowernumbers = Koha::Patron::Attributes->search(
{
code => $matchpoint_attr_type->code,
attribute => $attr->{attribute}
}
)->get_column('borrowernumber');
$borrowernumber = $borrowernumbers[0] if scalar(@borrowernumbers) == 1;
$patron = Koha::Patrons->find( $borrowernumber );
last;

View File

@ -217,7 +217,6 @@ my $params_4 = { file => $handle_4, matchpoint => $attribute->{code}, };
# When ...
my $result_4 = $patrons_import->import_patrons($params_4);
use Data::Printer colored => 1; warn p $result_4;
# Then ...
is($result_4->{already_in_db}, 0, 'Got the expected 0 already_in_db from import_patrons with extended user');