From c252ab6a878cc97da97739b0fb5434692e12bb4b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 21 Feb 2018 16:10:30 -0300 Subject: [PATCH] Bug 19936: Replace Check_userid - Update the occurrences Signed-off-by: Josef Moravec Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart --- Koha/Patrons/Import.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm index a8d17c15ba..fbf9701e92 100644 --- a/Koha/Patrons/Import.pm +++ b/Koha/Patrons/Import.pm @@ -200,13 +200,17 @@ sub import_patrons { next; } + # Check if the userid provided does not exist yet - if ( defined($matchpoint) and $matchpoint ne 'userid' and exists $borrower{userid} - and $borrower{userid} - and ( $patron and not $patron->userid($borrower{userid})->has_valid_userid ) ) { - push @errors, { duplicate_userid => 1, userid => $borrower{userid} }; - $invalid++; - next LINE; + if ( defined($matchpoint) + and $matchpoint ne 'userid' + and exists $borrower{userid} + and $borrower{userid} + and not Koha::Patron->new( { userid => $borrower{userid} } )->has_valid_userid + ) { + push @errors, { duplicate_userid => 1, userid => $borrower{userid} }; + $invalid++; + next LINE; } if ($borrowernumber) { -- 2.39.5