Bug 29254 - Setting wrong dates on additional-contents.pl
Summary: Setting wrong dates on additional-contents.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
: 29276 (view as bug list)
Depends on: 28961
Blocks:
  Show dependency treegraph
 
Reported: 2021-10-15 17:43 UTC by Lucas Gass
Modified: 2022-06-06 20:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00


Attachments
Bug 29254: Fix date formatting on the additional contents form (1.98 KB, patch)
2021-10-18 09:51 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 29254: Fix date formatting on the additional contents form (2.07 KB, patch)
2021-10-18 10:05 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 29254: Fix date formatting on the additional contents form (2.09 KB, patch)
2021-10-18 17:19 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass 2021-10-15 17:43:37 UTC
To recreate:

1. Go to Tools > News or Tools > HTML customization
2. Make a New entry. Set a Publication date and Expiration date. ( if you leave them unset thats OK too, you will still experience the bug)
3. Save the entry
4. Open it again with either CodeMirror or TinyMCE.
5. The Publication date and Expiration date are set far into the future ( for me it is always setting it to 08/06/2026 )
6. Your content will no longer appear in the area it is supposed.
Comment 1 Lucas Gass 2021-10-15 22:05:05 UTC
Apologies, I may have been too quick in blaming this on Flatpickr or Bug 28961. This may have more to do with Bug 24387.
Comment 2 Lucas Gass 2021-10-17 19:09:42 UTC
It does appear to be Flatpickr and date Formats. When the dateformat string that is passed to the Flatpickr config is set to 'Y-m-d' it properly sets the date. With all other date formats it sets a wrong date.
Comment 3 Jonathan Druart 2021-10-18 09:51:39 UTC
Created attachment 126418 [details] [review]
Bug 29254: Fix date formatting on the additional contents form

We are sending ymd but flatpickr is expecting a 'dateformat' formatted
date.

Test plan:
Create a new content, set a date, save, edit again
=> The date must be displayed correctly
Comment 4 Marcel de Rooy 2021-10-18 09:58:36 UTC
Here is our friend again:

 FAIL   koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt
   FAIL   valid_template
                Attempt to reload Koha/Template/Plugin/Branches.pm aborted.
Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.28/Template/Plugins.pm line 206.
Comment 5 Marcel de Rooy 2021-10-18 10:05:34 UTC
Created attachment 126422 [details] [review]
Bug 29254: Fix date formatting on the additional contents form

We are sending ymd but flatpickr is expecting a 'dateformat' formatted
date.

Test plan:
Create a new content, set a date, save, edit again
=> The date must be displayed correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 6 Marcel de Rooy 2021-10-18 10:06:10 UTC
Taking liberty to PQA in one pass
Comment 7 Lucas Gass 2021-10-18 17:19:29 UTC
Created attachment 126451 [details] [review]
Bug 29254: Fix date formatting on the additional contents form

We are sending ymd but flatpickr is expecting a 'dateformat' formatted
date.

Test plan:
Create a new content, set a date, save, edit again
=> The date must be displayed correctly

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 8 Lucas Gass 2021-10-18 17:20:35 UTC
Adding my sign-off here for good measure. Works with all dateformat options. 

Thanks Jonathan and Marcel.
Comment 9 Jonathan Druart 2021-10-19 07:45:16 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 10 Jonathan Druart 2021-10-22 12:25:35 UTC
*** Bug 29276 has been marked as a duplicate of this bug. ***