Bug 12598: Allow matched patron to be updated

When a test was introduced to not add duplicate userids
it overlooked that if you were matching on userid you
do not want the update to be rejected.

Add a test to overcome this logical flaw if updating
by matching userid

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Colin Campbell 2017-08-10 13:56:24 +01:00 committed by Jonathan Druart
parent b361ff2d7d
commit 8f8eb35c2f
1 changed files with 1 additions and 1 deletions

View File

@ -199,7 +199,7 @@ sub import_patrons {
}
# Check if the userid provided does not exist yet
if ( exists $borrower{userid}
if ( $matchpoint ne 'userid' and exists $borrower{userid}
and $borrower{userid}
and not Check_Userid( $borrower{userid}, $borrower{borrowernumber} ) ) {
push @errors, { duplicate_userid => 1, userid => $borrower{userid} };