[Bug 33132] New: Searching by DOB still broken in 22.05.x
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Bug ID: 33132 Summary: Searching by DOB still broken in 22.05.x Change sponsored?: --- Product: Koha Version: 22.05 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com In 22.05.x the fix for Bug 32505 is not working. I think it is because it relies on day.js, which is not in 22.05. We still need a fix for oldstable. -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |32505 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 [Bug 32505] Cannot search by dateofbirth in specified dateformat -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|32505 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32505 [Bug 32505] Cannot search by dateofbirth in specified dateformat -- 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=33132 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Lucas Gass <lucas@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=33132 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 147738 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147738&action=edit Bug 33132: Fix DOB search for 22.05 To test: 1. Apply patch 2. Search for patrons given their date of birth. You need to select "date of birth" in the "Search field" dropdown, or set it in DefaultPatronSearchFields. 3. Try with all the different dateformat's to make sure it works with each. -- 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=33132 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #2 from Andrew Fuerste-Henry <andrewfh@dubcolib.org> --- With the patch applied, I still only find patrons when searching YYYY-MM-DD. -- 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=33132 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 --- Comment #3 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 151969 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151969&action=edit Bug 33132: [ALTERNATE] [22.05.x] Add date_to_rfc3339 -- 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=33132 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com Status|Failed QA |Needs Signoff --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Andrew, could you try this patch? -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147738|0 |1 is obsolete| | -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=33132 --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 152052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=152052&action=edit Bug 33132: [22.05.x] Add date_to_rfc3339 Signed-off-by: Lucas Gass <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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151969|0 |1 is obsolete| | -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart+koha@gmail. |ity.org |com Keywords| |rel_22_05_candidate -- 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=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Passed QA --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Applies to 22.05.x. Not tested. koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc: window.$date_to_rfc3339 = function(value, options) { koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc: let d = $date_to_rfc3339(pattern); window.$date_to_rfc3339 = function(value, options) { var dateformat = (options&&options.dateformat)||def_date_format; let m = moment(value, get_date_pattern(dateformat)); return m.format("YYYY-MM-DD"); } Just some observations, not blocking: Why do you have options if you do not use them? Why do you call get_date_pattern if you format YMD later on? Looks good to me for the rest. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 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=33132 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Marcel de Rooy from comment #6)
Applies to 22.05.x. Not tested.
koha-tmpl/intranet-tmpl/prog/en/includes/js-date-format.inc: window.$date_to_rfc3339 = function(value, options) { koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc: let d = $date_to_rfc3339(pattern);
window.$date_to_rfc3339 = function(value, options) { var dateformat = (options&&options.dateformat)||def_date_format; let m = moment(value, get_date_pattern(dateformat)); return m.format("YYYY-MM-DD"); }
Just some observations, not blocking: Why do you have options if you do not use them?
This function has a bad and wrong history. This version is the one in master. options is there because it was there before, and it is consistent with the other function in the same file.
Why do you call get_date_pattern if you format YMD later on? Looks good to me for the rest.
You need to tell moment in which format is the string you are passing it. What we are doing is: let m = moment("20/06/2023", "DD/MM/YYYY"); // DD/MM/YYYY (indirectly) coming from dateformat m is a moment object you want to dispay the rfc3339/ymd version, and you ask moment to format it like that: m.format("YYYY-MM-DD") Does that make sense now? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #7)
You need to tell moment in which format is the string you are passing it.
What we are doing is: let m = moment("20/06/2023", "DD/MM/YYYY"); // DD/MM/YYYY (indirectly) coming from dateformat m is a moment object you want to dispay the rfc3339/ymd version, and you ask moment to format it like that: m.format("YYYY-MM-DD")
Does that make sense now?
Look at this code in the same file: window.$date = function(value, options) { if(!value) return ''; var tz = (options&&options.tz)||def_tz; var m = moment(value); -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Really, here we are just copying the code from master. All this needs to be rewritten, I agree with that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Why is this still here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to oldoldstable --- Comment #11 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcomoing 22.05.16. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_22_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33132 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldoldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org