The cardnumber field in the Patron record is currently limited to 16 characters. We do not use patron cards. We prefer to use the user's email address as the card number as it is unique to that person and they can remember this. However the domain section of our work email for one of our sites is 14 characters before prefixing it with firstname.lastname Therefore when saving the record this truncates after the first 16 characters. We would like the cardnumber field length to be extended, say to 40 characters
I'm sure there's not any problem with making the field longer (other than finding someone to do the work), but I'm wondering why you don't enter the patron's email address as their username and have Koha auto-generate card numbers? That way Koha handles the card numbers without you having to think about it, and the user can log in to their account using their email address.
Owen, Thanks for your quick reply. I must admit I hadn't thought of that option. I have just tried it out and I think this would actually work better as it is one less field to worry about when creating a new patron record. We usually look up the user by surname in the staff client when checking something out. So this bug can be closed I think. Also related is this one which would automatically align the username login to the email address field. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=2237 Jeremy
We are also having an issue with the 16 digit character limit. Our card readers output a trailing equals sign and then send a backspace keystroke to remove it when swiping a card. Since our card numbers are 16 digits the equals sign never gets typed into the field and the backspace removes the last digit of the card number. We can't reprogram the card readers because it would leave the equals sign in other fields that we swipe card numbers into. We are currently using a bit of javascript to extend the maxlength, but it would be great to see the character limit extended.
There is CardnumberLength system preference but it doesn't change the max length of the cardnumber when trying to edit x patron's cardnumber. Does anyone know what is the purpose of this preference, does it change the cardnumber length somewhere else?
The code specifies that if the cardnumber length from the system preference is to big, it will consider it as the biggest authorized value
Created attachment 64428 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - set the value of CardnumberLength to a value between 16 and 20 4 - Check you can enter a propper cardnumber
Created attachment 64487 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - set the value of CardnumberLength to a value between 16 and 20 4 - Check you can enter a propper cardnumber (modify to 32 instead 20)
(In reply to Baptiste from comment #7) > Created attachment 64487 [details] [review] [review] > Bug 13178: increase max value of CardnumberLength > > testplan > 1 - Apply patch > 2 - Run updatedatabase.pl > 3 - set the value of CardnumberLength to a value between 16 and 20 > 4 - Check you can enter a propper cardnumber > (modify to 32 instead 20) I tested by setting CardnumberLength to 20,32 for min 20 and max 32 However in cgi-bin/koha/members/memberentry.pl I get: "Card number must be between 16 and 32 characters." ...and I can enter an card number inside this range, e.g. a length of 18. Expected: Correct validation (card number length between 20 and 32).
Created attachment 64644 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - Update dbix scheme 4 - set the value of CardnumberLength to a value between 16 and 32 5 - Check you can enter a propper cardnumber (modify to 32 instead 20) + max value now depends on the database field value to
Created attachment 64645 [details] [review] Bug 13178: Correct Max cardnumberlength ($max is the value of the max size of a card number) - $max not hardcoded anymore in C4::Memeber - $max now correctly adapts to the field of cardnumber in database
@Marc Veron Sorry I didn't write to update the DBix schema, if you do this this should correct your problem However you discovered another bug: max size should be set to 16 in your case, because you had a wrong max value Please apply second patch and try again ;) To test the second patch: -> set your syspref to (100,200) before applying patch => max shouldn't change -> do the same after applying patch => max should change
Tested both patches together, will sign off.
Created attachment 64646 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - Update dbix scheme 4 - set the value of CardnumberLength to a value between 16 and 32 5 - Check you can enter a propper cardnumber (modify to 32 instead 20) + max value now depends on the database field value to Signed-off-by: Marc Véron <veron@veron.ch>
Created attachment 64647 [details] [review] Bug 13178: Correct Max cardnumberlength ($max is the value of the max size of a card number) - $max not hardcoded anymore in C4::Memeber - $max now correctly adapts to the field of cardnumber in database Signed-off-by: Marc Véron <veron@veron.ch>
@QAer, take a look at bug 10267 as well.
*** Bug 18338 has been marked as a duplicate of this bug. ***
Created attachment 68473 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - Update dbix scheme 4 - set the value of CardnumberLength to a value between 16 and 32 5 - Check you can enter a propper cardnumber (modify to 32 instead 20) + max value now depends on the database field value to Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 68474 [details] [review] Bug 13178: Correct Max cardnumberlength ($max is the value of the max size of a card number) - $max not hardcoded anymore in C4::Memeber - $max now correctly adapts to the field of cardnumber in database Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 68475 [details] [review] Bug 13178: QA Followup - fix kohastructure and update info in fields Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Looks good here, added the max length to syspref notes so want an opinion on that
Created attachment 68553 [details] [review] Bug 13178: increase max value of CardnumberLength testplan 1 - Apply patch 2 - Run updatedatabase.pl 3 - Update dbix scheme 4 - set the value of CardnumberLength to a value between 16 and 32 5 - Check you can enter a propper cardnumber (modify to 32 instead 20) + max value now depends on the database field value to Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 68554 [details] [review] Bug 13178: Correct Max cardnumberlength ($max is the value of the max size of a card number) - $max not hardcoded anymore in C4::Memeber - $max now correctly adapts to the field of cardnumber in database Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 68555 [details] [review] Bug 13178: QA Followup - fix kohastructure and update info in fields Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Checked Nick's follow-up and liked it :)
Pushed to master for 17.11, thanks to everybody involved!