https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26352 --- Comment #42 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #41)
(In reply to Martin Renvoize from comment #8)
There's an undocumented feature here: When 'autoMemberNum' is enabled there's a second plugin hook available called 'barcode_generate'.
I'm wondering if this needs to be an explicit method of it's own as currently implemented or it could just be the case for when an empty or undefined cardnumber is passed to the patron_barcode_transform hook?
Apparently this was already discussed.
I would've preferred a second hook for sure. I thought maybe it would be safe to create a new cardnumber when it's empty/undefined, but Koha::Patron::store() has some oddities. Like "patron_barcode_transform" gets called twice if you're using autoMemberNum... and fixup_cardnumber() assumes the output of autoMemberNum is an integer, which seems presumptuous especially when the original use case talked about prefixing/suffixing cardnumbers with letters...
I've developed a plugin to create an alphanumeric cardnumber if there's no cardnumber passed into "patron_barcode_transform", and yeah it doesn't work if you're using "autoMemberNum". If you're using "autoMemberNum", the cardnumber referenced in "patron_barcode_transform" must be a positive integer, or you'll run into strife. -- You are receiving this mail because: You are watching all bug changes.