[Bug 37542] New: Patron search is incorrectly parsing entries as dates and fetching the wrong patron if dateofbirth in search fields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Bug ID: 37542 Summary: Patron search is incorrectly parsing entries as dates and fetching the wrong patron if dateofbirth in search fields Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When parsing patron search we try to convert the input into a date for searching against dateofbirth if included in defaultpatronsearchfields This can lead to odd values being converted to incorrect dates. To recreate" 1 - Create a patron with dateofbirth 1994-07-27 2 - Add dateofbirth to DefaultPatronSearchFields 3 - In patron or checkout search, type a cardnumber like '2908800092528' 4 - Note the patron with that birth date is found in autocomplete 5 - Open the browser console (F12) 6 - In the network tab, find the last request (or just remove and add a digit) 7 - Copy the URL from that request and paste into a text editor 8 - Search for 'dateofbirth' 9 - See that the entry has been converted to 1994-07-27 -- 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=37542 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Brendan Lawlor <blawlor@clamsnet.org> 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=37542 --- Comment #1 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 170571 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170571&action=edit Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField This patch updates the call to dayjs to use strict parsing for patron search. See https://day.js.org/docs/en/parse/string-format To test: 1. Create a patron with dateofbirth 1994-07-27 2. Add dateofbirth to DefaultPatronSearchFields 3. In patron or checkout search, type a cardnumber like '2908800092528' 4. Note the patron with that birth date is found in autocomplete 5. Apply patch and restart_all 6. Repeat step 3 and notice the patron is no longer found 7. In patron or checkout search, try searches using a formatted date 8. Confirm searches for '07/27/1994' and '1994-07-27' find the patron -- 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=37542 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |blawlor@clamsnet.org |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=37542 Nick Clemens (kidclamp) <nick@bywatersolutions.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=37542 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #170571|0 |1 is obsolete| | --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 170609 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=170609&action=edit Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField This patch updates the call to dayjs to use strict parsing for patron search. See https://day.js.org/docs/en/parse/string-format To test: 1. Create a patron with dateofbirth 1994-07-27 2. Add dateofbirth to DefaultPatronSearchFields 3. In patron or checkout search, type a cardnumber like '2908800092528' 4. Note the patron with that birth date is found in autocomplete 5. Apply patch and restart_all 6. Repeat step 3 and notice the patron is no longer found 7. In patron or checkout search, try searches using a formatted date 8. Confirm searches for '07/27/1994' and '1994-07-27' find the patron Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #3 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Trivial patch, big impact, moving to PQA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |24.11.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=37542 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.11! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Version(s)|24.11.00 |24.11.00,24.05.04 released in| | Status|Pushed to main |Pushed to stable --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 24.05.x for upcoming 24.05.04 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #6 from Jonathan Druart <jonathan.druart@gmail.com> --- I would like to note that the test plan focuses on dob patron search, but date_to_rfc is actually use for all the date searches using DT/REST API. As well in UsageStatisticsDataProvidersList.vue. Side-effects are possible. However I think it's a correct change, maybe we should also apply it to other functions from js-date-format.inc -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #7 from Fridolin Somers <fridolin.somers@biblibre.com> --- I prefer not impact oldstable since side-effects are possible -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |aude.charillon@openfifth.co | |.uk --- Comment #8 from Aude Charillon <aude.charillon@openfifth.co.uk> --- This is also an issue in 23.11 (last spotted in 23.11.14). It would be really useful if the patch could be backported to this version, please. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_23_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37542 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #9 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- 23.11 out of support now Not backporting to 22.11 unless requested -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org