Bug 29711 - Release date not passed as ISO to about.tt
Summary: Release date not passed as ISO to about.tt
Status: RESOLVED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
Depends on: 29403
Blocks:
  Show dependency treegraph
 
Reported: 2021-12-16 14:21 UTC by Tomás Cohen Arazi
Modified: 2022-06-02 13:08 UTC (History)
3 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:


Attachments
Bug 29711: Pass release date in ISO to about.tt (1.45 KB, patch)
2021-12-16 14:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2021-12-16 14:21:09 UTC
When parsing the teams.yaml file, the release date is (correctly) parsed from epoch into a DateTime, but the $KohaDates filter expects 'iso' formatted dates, and stringifying the 'dt' object leads to non-comformant datetime format.

To test:
1. On current master
2. Point your staff interface to the About page
=> FAIL: It explodes because of date formats
Comment 1 Tomás Cohen Arazi 2021-12-16 14:26:29 UTC
Created attachment 128627 [details] [review]
Bug 29711: Pass release date in ISO to about.tt

This patch makes the date be converted into ISO format so it is
correctly handled by the KohaDates TT filter.

To test:
1. Point your browser to the about page
=> FAIL: It explodes:
   Template process failed: undef error - The given date (2022-05-22T00:00:01) does not match the date format (iso)
2. Apply this patch
3. Restart:
   $ koha-plack --restart kohadev
4. Repeat 1
=> SUCCESS: It doesn't explode, shows the right date!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 Jonathan Druart 2021-12-16 15:07:39 UTC
This is really ugly...
Comment 3 Jonathan Druart 2021-12-16 15:08:49 UTC
I meant, not your patch :)

But what we need to do. That is plain wrong.
Comment 4 David Nind 2022-01-07 17:36:28 UTC
I can't replicate this on master and using KTD.

Does this only apply for a specific version?
Comment 5 Fridolin Somers 2022-04-30 04:34:04 UTC
(In reply to David Nind from comment #4)
> I can't replicate this on master and using KTD.
Same for me.
And I dont see where this date is used.
Comment 6 Jonathan Druart 2022-06-02 08:02:57 UTC
No idea why this has been magically fixed..

If there is something to clean, it will be on bug 30718.
Comment 7 Tomás Cohen Arazi 2022-06-02 13:08:43 UTC
(In reply to Jonathan Druart from comment #6)
> No idea why this has been magically fixed..

DateTime magician, I summon theeeeee