[Bug 28351] New: Cannot set restrictions when dateformat is other than mm/dd/yyyy
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Bug ID: 28351 Summary: Cannot set restrictions when dateformat is other than mm/dd/yyyy Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Format is not correctly applied, so any date that doesn't parse well as mm/dd/yyyy is reset to current date. To reproduce: 0. Set dateformat to mm/dd/yyyy 1. Go to a patron detail page 2. Open the 'Restrictions' tab 3. Choose a future date in which the day is higher than 12 => SUCCESS: The input has the date we chose 4. Set dateformat to dd/mm/yyyy 5. Repeat 3 => FAIL: It sets the current date, the browser console shows an error. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26261 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Certainly caused by 26261. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26261 [Bug 26261] Split calendar.inc into include file and JavaScript file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=28351 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 121017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121017&action=edit Bug 28351: Update to latest jquery-ui-timepicker-addon This patch updates to the latest version of the library. It fixes the collision there seems to exist between our version of JQuery, JQuery-UI and the datetime plugin. Note: It feels like we should get rid of this library as this version dates back to 2016. Our previous version (1.4.3) was dated November 2013. The author recomends moving to https://flatpickr.js.org/ Anyway, this solves our urgent issues. To test: 1. Have dateformat set to something other than 'us' (I picked dd/mm/yyyy). 2. Open your browser inspector in the console 3. Find a patron on the staff interface 4. Try tadding a restriction dated at some date in which the day number is higher than 12 => FAIL: It puts the current day (as a fallback), an error about the passed date being invalid is reported in the console 5. Apply this patch and reload all the things, just in case 6. Repeat 4 => SUCCESS: It picks the date, no noticeable problems 7. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #3 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This solves the conflict, but the time selector now has milliseconds and timezone selection. I don't have the time to dig into it as the kids are up early this saturday. For that reason I don't mark it NSO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #4 from David Nind <david@davidnind.com> --- I have tested and everything works as per the test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #5 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Tomás Cohen Arazi from comment #3)
This solves the conflict, but the time selector now has milliseconds and timezone selection. I don't have the time to dig into it as the kids are up early this saturday. For that reason I don't mark it NSO.
If we use v1.6.3 for the timepicker than I believe we need to add the v1.6.3 minified CSS. Then it must be called on the templates that use the timepicker: git grep 'timepicker.inc': koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 121068 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121068&action=edit Bug 28351: Add v1.6.3 CSS and update templates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_21_05_candidate Assignee|oleonard@myacpl.org |tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Lucas Gass from comment #5)
(In reply to Tomás Cohen Arazi from comment #3)
This solves the conflict, but the time selector now has milliseconds and timezone selection. I don't have the time to dig into it as the kids are up early this saturday. For that reason I don't mark it NSO.
If we use v1.6.3 for the timepicker than I believe we need to add the v1.6.3 minified CSS. Then it must be called on the templates that use the timepicker:
git grep 'timepicker.inc': koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
Great job, Lucas. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 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=28351 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121017|0 |1 is obsolete| | --- Comment #8 from David Nind <david@davidnind.com> --- Created attachment 121069 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121069&action=edit Bug 28351: Update to latest jquery-ui-timepicker-addon This patch updates to the latest version of the library. It fixes the collision there seems to exist between our version of JQuery, JQuery-UI and the datetime plugin. Note: It feels like we should get rid of this library as this version dates back to 2016. Our previous version (1.4.3) was dated November 2013. The author recomends moving to https://flatpickr.js.org/ Anyway, this solves our urgent issues. To test: 1. Have dateformat set to something other than 'us' (I picked dd/mm/yyyy). 2. Open your browser inspector in the console 3. Find a patron on the staff interface 4. Try tadding a restriction dated at some date in which the day number is higher than 12 => FAIL: It puts the current day (as a fallback), an error about the passed date being invalid is reported in the console 5. Apply this patch and reload all the things, just in case 6. Repeat 4 => SUCCESS: It picks the date, no noticeable problems 7. Sign off :-D 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=28351 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121068|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 121070 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121070&action=edit Bug 28351: Add v1.6.3 CSS and update templates 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=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 121080 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121080&action=edit [ALTERNATIVE] Bug 28351: (bug 26261) Fix datepicker for dateformat ne mm/dd/yyyy This patch restores the same code we have prior to bug 26261 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Tomas, why did you take the hard path? This patch uses the same code for both "on change" event and restores what was done prior to bug 26261. It fixes the problem and seems way easier for backport. What do you think? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #12 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #11)
Tomas, why did you take the hard path?
This patch uses the same code for both "on change" event and restores what was done prior to bug 26261. It fixes the problem and seems way easier for backport.
What do you think?
Basically, because I saw how old the library was. I'm fine with either solution. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #13 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- I think we should pick the small patch for backport, then test carefully the version change (like during 21.06). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121070|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121069|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|tomascohen@gmail.com |jonathan.druart+koha@gmail. | |com QA Contact|testopia@bugs.koha-communit |tomascohen@gmail.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=28351 --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #13)
I think we should pick the small patch for backport, then test carefully the version change (like during 21.06).
Yeah, if we are going to spend time testing side-effects from changing the library we should just move into flatpickr or similar. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Lucas and I have tried to SO this patch, but: $ git bz edit 28351 Traceback (most recent call last): File "/usr/local/bin/git-bz", line 2705, in <module> do_edit(*args) File "/usr/local/bin/git-bz", line 2377, in do_edit edit_bug(bug) File "/usr/local/bin/git-bz", line 2181, in edit_bug lines = edit_template(template.getvalue()) File "/usr/local/bin/git-bz", line 820, in edit_template f.write(template) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 703: ordinal not in range(128) Not sure what's going on with BZ. If you can, Jonathan, please stamp our signatures on pushing. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=28376 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Cannot set restrictions |Cannot set restrictions |when dateformat is other |when 'dateformat' is other |than mm/dd/yyyy |than 'us' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121080|[ALTERNATIVE] Bug 28351: |[ALTERNATIVE] Bug 28351: description|(bug 26261) Fix datepicker |(bug 26261) Fix datepicker |for dateformat ne |for dateformat ne |mm/dd/yyyy |mm/dd/yyyy -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #121080|0 |1 is obsolete| | --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 121163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=121163&action=edit Bug 28351: (bug 26261) Fix datepicker for dateformat ne mm/dd/yyyy This patch restores the same code we have prior to bug 26261 0. Set dateformat to mm/dd/yyyy 1. Go to a patron detail page 2. Open the 'Restrictions' tab 3. Choose a future date in which the day is higher than 12 => SUCCESS: The input has the date we chose 4. Set dateformat to dd/mm/yyyy 5. Repeat 3 => FAIL: It sets the current date, the browser console shows an error. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #15)
Lucas and I have tried to SO this patch, but:
$ git bz edit 28351 Traceback (most recent call last): File "/usr/local/bin/git-bz", line 2705, in <module> do_edit(*args) File "/usr/local/bin/git-bz", line 2377, in do_edit edit_bug(bug) File "/usr/local/bin/git-bz", line 2181, in edit_bug lines = edit_template(template.getvalue()) File "/usr/local/bin/git-bz", line 820, in edit_template f.write(template) UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 703: ordinal not in range(128)
Not sure what's going on with BZ. If you can, Jonathan, please stamp our signatures on pushing.
For the record, there was a non-breaking space after "[ALTERNATIVE]". Sorry about that. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |21.05.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=28351 --- Comment #18 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.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=28351 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.06 released in| | Status|Pushed to master |Pushed to stable --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com Version(s)|21.05.00,20.11.06 |21.05.00,20.11.06,20.05.12 released in| | Status|Pushed to stable |Pushed to oldstable --- Comment #20 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Pushed to 20.05.x for 20.05.12 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED --- Comment #21 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Missing dependencies for 19.11.x, it shouldn't be affected, no backport. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28351 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |28538 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28538 [Bug 28538] Regression - Date of birth entered without correct format causes internal server error -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org