Summary: | Patron search is incorrectly parsing entries as dates and fetching the wrong patron if dateofbirth in search fields | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Patrons | Assignee: | Brendan Lawlor <blawlor> |
Status: | RESOLVED FIXED | QA Contact: | Nick Clemens (kidclamp) <nick> |
Severity: | major | ||
Priority: | P5 - low | CC: | aude.charillon, blawlor, fridolin.somers, gmcharlt, jonathan.druart, kyle, Laura.escamilla, lucas, wainuiwitikapark |
Version: | Main | Keywords: | rel_23_11_candidate |
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
24.11.00,24.05.04
|
Circulation function: | |
Attachments: |
Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField
Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField |
Description
Nick Clemens (kidclamp)
2024-07-31 19:37:59 UTC
Created attachment 170571 [details] [review] 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 Created attachment 170609 [details] [review] 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> Trivial patch, big impact, moving to PQA Pushed for 24.11! Well done everyone, thank you! Backported to 24.05.x for upcoming 24.05.04 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 I prefer not impact oldstable since side-effects are possible 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. 23.11 out of support now Not backporting to 22.11 unless requested |