From 514e3879e994786f12620801b2c228bbf2945b51 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 --- 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.14.1