[Bug 32491] New: Special characters causes patron search to fail
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Bug ID: 32491 Summary: Special characters causes patron search to fail Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: Laura.escamilla@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Using a comma when searching for patrons such as "Smith, John" will show no results. However, searching for "Smith John" will pull all related patron records. -- 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=32491 --- Comment #1 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I don't think the special character is the issue here - the problem is, that the comma is not part of the data, so you get no match. As we are doing an SQL based search here I am not sure what could be done to make this easily possible - removing the comma or other characters by default might break some searches? -- 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=32491 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #2 from David Cook <dcook@prosentient.com.au> --- (In reply to Katrin Fischer from comment #1)
As we are doing an SQL based search here I am not sure what could be done to make this easily possible - removing the comma or other characters by default might break some searches?
Hmm maybe normalizing the search to remove punctuation isn't a bad idea. I normalize the search for phone number (see bug 23817) although it can actually be fairly difficult to do in the newest versions of Koha because of how we use the REST API for patron search... -- 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=32491 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal CC| |lucas@bywatersolutions.com -- 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=32491 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- This also effects wildcard searches. Previously you could search for a cardnumber like '2913*' and that would return all patrons with cardnumbers starting with '2913'. Now it tries searching for the exact match '2352*' and returns nothing. -- 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=32491 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Lucas Gass from comment #3)
This also effects wildcard searches. Previously you could search for a cardnumber like '2913*' and that would return all patrons with cardnumbers starting with '2913'. Now it tries searching for the exact match '2352*' and returns nothing.
I don't think * has worked, but it automatically did a begin with. % should probably still work? -- 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=32491 PPLCS <admin@pplcs.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |admin@pplcs.net --- Comment #5 from PPLCS <admin@pplcs.net> --- We desperately need this fixed! -- 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=32491 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to PPLCS from comment #5)
We desperately need this fixed!
Can you explain the problem a bit more as it manifests for you? Has this worked before? I am not aware of it, but not totally user as we had some changes to patron search recently. As I said the problem with comma is that it's not part of the data, it's not failing because of being a special character. If the comma was in your data, you should be able to search for it without issues. -- 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=32491 --- Comment #7 from PPLCS <admin@pplcs.net> --- Entering in "Doe, John" in the patron search field worked before the last Koha update. As a librarian I'm hardwired to type in last name first, comma, first name. So this is a real problem when looking up patrons. -- 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=32491 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Summary|Special characters causes |Can no longer search |patron search to fail |patrons in format Keywords| |regression -- 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=32491 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Can no longer search |Can no longer search |patrons in format |patrons in format 'surname, | |firstname' -- 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=32491 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Katrin Fischer from comment #6)
Has this worked before?
Patron searching works correctly in 22.05 with the comma included, so this is a regression. -- 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=32491 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Owen Leonard from comment #8)
(In reply to Katrin Fischer from comment #6)
Has this worked before?
Patron searching works correctly in 22.05 with the comma included, so this is a regression.
Thx for confirming, I already marked it as such and added Joubu in CC. -- 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=32491 Jonathan Druart <jonathan.druart+koha@gmail.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=32491 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 145054 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145054&action=edit Bug 32491: Split patron search terms on comma Previous behaviour allowed search 'surname, firstname'. We should remove the comma from the search terms. Test plan: On the main patron search, search for "surname, firstname" and confirm that with this patch applied the search returns the expected results. -- 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=32491 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_22_11_candidate Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com Depends on| |30063 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30063 [Bug 30063] Make the main patron search use the /patrons REST API route -- 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=32491 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Owen Leonard from comment #8)
(In reply to Katrin Fischer from comment #6)
Has this worked before?
Patron searching works correctly in 22.05 with the comma included, so this is a regression.
Hum I am expecting a regression caused by 30063 or 30093 and both are in 22.05 Also I see, in 22.05.x includes/patron-search.inc 314 let patterns = pattern.split(' ').filter(function(s){ return s.length }); I haven't tested though. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 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=32491 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145054|0 |1 is obsolete| | --- Comment #12 from David Nind <david@davidnind.com> --- Created attachment 145058 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145058&action=edit Bug 32491: Split patron search terms on comma Previous behaviour allowed search 'surname, firstname'. We should remove the comma from the search terms. Test plan: On the main patron search, search for "surname, firstname" and confirm that with this patch applied the search returns the expected results. 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=32491 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #13 from David Nind <david@davidnind.com> --- Testing notes (using KTD): 1. For me, this fixes the search from the 'Search for patron' box on the patrons page 2. In the header search it continues to work, however I note that if you search for example for 'burton' then this gives you the autocomplete results. However, if you search for 'Burton,' it doesn't show in autocomplete (but does give you the correct result when you click the button to search). Searching for 'burton mary' will give you the autocomplete results. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Esther Melander <estherm@sodaspringsid.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |estherm@sodaspringsid.com --- Comment #14 from Esther Melander <estherm@sodaspringsid.com> --- In regards to the wild card searches in the patron field, Should this be a separate ticket? Prior to our upgrade to 22.05, we could do searches like 2913*3456 and have it return results. After the upgrade this no longer works. The % wildcard appears to work in the search example above. However the % as a wildcard is odd when compared with how other search indexes work. Most major search engines use either an asterisk or a question mark. The same is true with searching indexes at Ancestry or Family Search. The asterisk replaces multiple characters and the question mark replaces a single character. Most of our staff is accustomed to using an asterisk and trying to adapt to a different nomenclature and keyboard position has proven difficult. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 --- Comment #15 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 145077 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145077&action=edit Bug 32491: Split patron search terms on comma - autocomplete -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to David Nind from comment #13)
2. In the header search it continues to work, however I note that if you search for example for 'burton' then this gives you the autocomplete results. However, if you search for 'Burton,' it doesn't show in autocomplete (but does give you the correct result when you click the button to search). Searching for 'burton mary' will give you the autocomplete results.
Good catch, that should be fixed here I think. The last patch is fixing it. (In reply to Esther Melander from comment #14)
In regards to the wild card searches in the patron field, Should this be a separate ticket?
Yes, please open a separate bug report. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 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=32491 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145058|0 |1 is obsolete| | --- Comment #17 from David Nind <david@davidnind.com> --- Created attachment 145078 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145078&action=edit Bug 32491: Split patron search terms on comma Previous behaviour allowed search 'surname, firstname'. We should remove the comma from the search terms. Test plan: On the main patron search, search for "surname, firstname" and confirm that with this patch applied the search returns the expected results. 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=32491 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145077|0 |1 is obsolete| | --- Comment #18 from David Nind <david@davidnind.com> --- Created attachment 145079 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145079&action=edit Bug 32491: Split patron search terms on comma - autocomplete 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=32491 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=32491 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145078|0 |1 is obsolete| | Attachment #145079|0 |1 is obsolete| | --- Comment #19 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145083 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145083&action=edit Bug 32491: Split patron search terms on comma Previous behaviour allowed search 'surname, firstname'. We should remove the comma from the search terms. Test plan: On the main patron search, search for "surname, firstname" and confirm that with this patch applied the search returns the expected results. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 --- Comment #20 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 145084 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145084&action=edit Bug 32491: Split patron search terms on comma - autocomplete Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 --- Comment #21 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|23.05.00 |23.05.00,22.11.02 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 --- Comment #22 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=32491 Michael Adamyk <madamyk@ckls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |madamyk@ckls.org --- Comment #23 from Michael Adamyk <madamyk@ckls.org> --- (In reply to Owen Leonard from comment #8)
(In reply to Katrin Fischer from comment #6)
Has this worked before?
Patron searching works correctly in 22.05 with the comma included, so this is a regression.
I'm running Koha 22.05.07, and this is affecting us. We can't do patron searches with commas or we get no results. I don't know if it was present in previous versions of 22.05 or not. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.05.00,22.11.02 |23.05.00,22.11.02,22.05.09 released in| | --- Comment #24 from Lucas Gass <lucas@bywatersolutions.com> --- I have backported the first patch to 22.05.x and that fixes the problem. The 2nd patch is not needed in 22.05.x as 'patron-autocomplete.js' does not exist yet. That would be dependent on Bug 30578. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |Pushed to oldoldstable CC| |arthur.suzuki@biblibre.com --- Comment #25 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- This one depends on 30063 which is not available on 21.11.x. not backporting. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldoldstable |RESOLVED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32491 Michael Adamyk <madamyk@ckls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|madamyk@ckls.org | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org