@@ -, +, @@ --- Koha/Patrons/Import.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) --- a/Koha/Patrons/Import.pm +++ a/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) { --