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 <galen.charlton@liblime.com>
This commit is contained in:
Galen Charlton 2009-05-08 08:44:03 -05:00
parent 9fb2d09ffc
commit 80eecc3f19
1 changed files with 1 additions and 1 deletions

View File

@ -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) {