[Bug 30514] New: Error in date format check following datepicker removal
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Bug ID: 30514 Summary: Error in date format check following datepicker removal Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: oleonard@myacpl.org QA Contact: testopia@bugs.koha-community.org CC: dcook@prosentient.com.au, lucas@bywatersolutions.com, testopia@bugs.koha-community.org Depends on: 30011 calendar.inc still contains a reference to a variable which was removed by Bug 30011. This creates an error when using Flatpickr in some contexts. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30011 [Bug 30011] Upgrade jQueryUI to 1.13.1 in the OPAC and staff interface -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 133218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133218&action=edit Bug 30514: Error in date format check following datepicker removal This patch corrects the is_valid_date function in the OPAC and staff interface so that it work correctly with Flatpickr. To test, apply the patch and clear your browser cache if necessary. - In the staff client, locate a bibliographic record and edit its items. - Test that the "Date acquired" date picker works correctly and that there are no errors in the browser console. - Test other date input fields to check that they still work, e.g. specify due date during checkout; Catalog statistics wizard; Patron entry/modification, etc. - Perform similar tests in the OPAC: Hold suspension; Update your personal details. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Bug 30514 depends on bug 30011, which changed state. Bug 30011 Summary: Upgrade jQueryUI to 1.13.1 in the OPAC and staff interface https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30011 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- *** Bug 30561 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 David Cook <dcook@prosentient.com.au> 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=30514 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #133218|0 |1 is obsolete| | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 133428 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133428&action=edit Bug 30514: Error in date format check following datepicker removal This patch corrects the is_valid_date function in the OPAC and staff interface so that it work correctly with Flatpickr. To test, apply the patch and clear your browser cache if necessary. - In the staff client, locate a bibliographic record and edit its items. - Test that the "Date acquired" date picker works correctly and that there are no errors in the browser console. - Test other date input fields to check that they still work, e.g. specify due date during checkout; Catalog statistics wizard; Patron entry/modification, etc. - Perform similar tests in the OPAC: Hold suspension; Update your personal details. Signed-off-by: David Cook <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=30514 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- With different date formats, things don't appear quite right: * Changed Dateformat DD.MM.YYYY * Edit any patron * Set or edit date of birth * Verify the date is shown with / still, instead of selected dateformat -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- In my testing today I found that it works but only after "restart_all." I don't know why this would be. Individually restarting plack, memcached, or apache doesn't help. Other system preferences, like IntranetUserCSS, are applied immediately without restart. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com 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=30514 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- What Katrin describes is not related to this bug report. It's very weird and I have no idea where it's coming from. I think there is still something wrong with this patch however. The is_valid_date does not work as we are expecting. We used to have an alert if the date was wrong. The following change will restore the historical behaviour: diff --git a/koha-tmpl/intranet-tmpl/prog/js/calendar.js b/koha-tmpl/intranet-tmpl/prog/js/calendar.js index 81561cc42d2..8ea4fbadfe6 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/calendar.js +++ b/koha-tmpl/intranet-tmpl/prog/js/calendar.js @@ -22,12 +22,7 @@ function is_valid_date(date) { if (date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1) return 0; dateformat = 'd.m.Y'; } - try { - flatpickr.parseDate(date, dateformat); - } catch (e) { - return 0; - } - return 1; + return flatpickr.parseDate(date, dateformat) ? 1 : 0; } function get_dateformat_str(dateformat) { -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #6)
What Katrin describes is not related to this bug report. It's very weird and I have no idea where it's coming from.
Hum, mornings... There is a bad space there: var dateformat_pref = "[% Koha.Preference('dateformat ') | html %]"; Not coming from this patch but bug 26261 (needs to be fixed separately). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- I think that within the scope of this bug report the patch should not be considered Failed QA. I've posted Bug 30673 - Improve is_valid_date function for validating date strings - to address the issues raised in comment 4, comment 6, and comment 7. But none of those issues are related to the changes made by this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Retesting this -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Testing this again I noticed this in the console with the patch applied: Source map error: Error: request failed with status 404 Resource URL: http://localhost:8081/intranet-tmpl/lib/flatpickr/shortcut-buttons-flatpickr... Source Map URL: shortcut-buttons-flatpickr.min.js.map separate bug? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30706 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Owen Leonard from comment #5)
In my testing today I found that it works but only after "restart_all." I don't know why this would be. Individually restarting plack, memcached, or apache doesn't help. Other system preferences, like IntranetUserCSS, are applied immediately without restart.
I am seeing the same behavior, after a restart_all it's ok. I filed: Bug 30706 - DateFormat change only takes effect after a restart of services -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Katrin Fischer <katrin.fischer@bsz-bw.de> 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=30514 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #133428|0 |1 is obsolete| | --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 134683 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=134683&action=edit Bug 30514: Error in date format check following datepicker removal This patch corrects the is_valid_date function in the OPAC and staff interface so that it work correctly with Flatpickr. To test, apply the patch and clear your browser cache if necessary. - In the staff client, locate a bibliographic record and edit its items. - Test that the "Date acquired" date picker works correctly and that there are no errors in the browser console. - Test other date input fields to check that they still work, e.g. specify due date during checkout; Catalog statistics wizard; Patron entry/modification, etc. - Perform similar tests in the OPAC: Hold suspension; Update your personal details. Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30673 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30673 [Bug 30673] Improve is_valid_date function for validating date strings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |30706 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30706 [Bug 30706] DateFormat change only takes effect after a restart of services -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.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=30514 --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to master for 22.05, thanks to everybody involved 🦄 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30514 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_22_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org