From 80eecc3f198315c0f1b63eccb799d753add2e95d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 8 May 2009 08:44:03 -0500 Subject: [PATCH] bug 2287: handle case where autoMemberNum is off When importing a patron file where new records do not have a card number *and* autoMemberNum is off, make sure that bororwers.cardnumber is set to NULL for those new patrons rather than '' - otherwise, only one patron with an empty barcode can be created, as there is a uniqueness constraint on borrowers.cardnumber Signed-off-by: Galen Charlton --- tools/import_borrowers.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl index 9ac994bc75..9738f19dc3 100755 --- a/tools/import_borrowers.pl +++ b/tools/import_borrowers.pl @@ -252,7 +252,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { # FIXME: fixup_cardnumber says to lock table, but the web interface doesn't so this doesn't either. # At least this is closer to AddMember than in members/memberentry.pl if (!$borrower{'cardnumber'}) { - $borrower{'cardnumber'} = fixup_cardnumber(''); + $borrower{'cardnumber'} = fixup_cardnumber(undef); } if ($borrowernumber = AddMember(%borrower)) { if ($extended) { -- 2.39.5