[Bug 32517] New: Patron search dies on case mismatch of patron category
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Bug ID: 32517 Summary: Patron search dies on case mismatch of patron category Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Staff interface Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com We load the categories in JS for transforming category codes to names, however, this introduces case sensitivity To recreate: 1 - sudo koha-mysql kohadev 2 - UPDATE borrowers SET categorycode = LCASE(categorycode) 3 - Try to search for patrons: Uncaught TypeError: categories_map[data] is undefined -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #1 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 144795 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144795&action=edit Bug 32517: lowercase category codes to avoid mismatch To test: 1 - sudo koha-mysql kohadev 2 - UPDATE borrowers SET categorycode = LCASE(categorycode) 3 - Try to search for patrons: Uncaught TypeError: categories_map[data] is undefined 4 - Apply patch 5 - Search for patrons 6 - Success! -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Assignee|koha-bugs@lists.koha-commun |nick@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144795|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 144805 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144805&action=edit Bug 32517: lowercase category codes to avoid mismatch To test: 1 - sudo koha-mysql kohadev 2 - UPDATE borrowers SET categorycode = LCASE(categorycode) 3 - Try to search for patrons: Uncaught TypeError: categories_map[data] is undefined 4 - Apply patch 5 - Search for patrons 6 - Success! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- But... should category codes not always be uppercase? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- In my opinion, yes. But, we have never enforced that. SQL is generally not case sensitive, unless you ask it to be - this is a consequence of Javascript. I think we should err on the side of codes needing to be unique, but not case sensitive -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #5 from David Nind <david@davidnind.com> --- Just noting that this issue (I think) was raised on the general mailing list: https://lists.katipo.co.nz/pipermail/koha/2023-January/058867.html Has a slightly different error message, but seems related to case sensitivity with patron category values. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This fixes patron search so release notes| |that searching by category | |will work regardless of the | |patron category code case | |(upper, lower, and sentence | |case). Before this, | |category codes in upper | |case were expected - where | |they weren't this caused | |the search to fail, | |resulting in no search | |results. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Nick Clemens from comment #4)
In my opinion, yes. But, we have never enforced that.
Not sure when that changed. But currently you cannot save a lowercase one in the interface. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144805|0 |1 is obsolete| | --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 145256 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145256&action=edit Bug 32517: lowercase category codes to avoid mismatch To test: 1 - sudo koha-mysql kohadev 2 - UPDATE borrowers SET categorycode = LCASE(categorycode) 3 - Try to search for patrons: Uncaught TypeError: categories_map[data] is undefined 4 - Apply patch 5 - Search for patrons 6 - Success! Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Confirm that this fixes the problem introduced by sql changing the category to lowercase. This is not possible now in the interface. So it is a bit arguable patch. But I dont object. Note that you could go the other way and add a dbrev that makes all categorycodes uppercase in borrowers for example. Marking it as major seems overkill btw. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #9 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Marcel de Rooy from comment #8)
Marking it as major seems overkill btw.
A few bad patrons could break the patron search at large - this is a huge impact for libraries that may have a hard time diagnosing the issue. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am still curious on how they ended up there in the first place. As long as I can remember you can't add lower case ones... could this be related to API/patron import/SQL based migrations? I am a little worried that if we fix this bug, it might just be a band aid in one spot while in other places we'll still see issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #10)
I am still curious on how they ended up there in the first place. As long as I can remember you can't add lower case ones... could this be related to API/patron import/SQL based migrations?
I am a little worried that if we fix this bug, it might just be a band aid in one spot while in other places we'll still see issues.
Yes, we believe related to API/patron imports, or just very old data -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to 23.05.x for the next release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00 |23.05.00,22.11.02 released in| | Status|Pushed to master |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #13 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Nice work, thanks everyone! Pushed to 22.11.x for the next release. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32706 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #14 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- We need to fix the root of the problem, during the import. We provide a script to catch this problem. We should not deal with that in the template, that's silly. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33539 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35743 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35743 [Bug 35743] The "category" filter is not selected in the column filter dropdown -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32517 --- Comment #15 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Jonathan Druart from comment #14)
We need to fix the root of the problem, during the import. We provide a script to catch this problem. We should not deal with that in the template, that's silly.
Still valid, this needs to be fixed properly. I am now writing workarounds in code that is trying to be generic for this specific "category" search. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org