Bug 29276 - Date automatically changes when editing news
Summary: Date automatically changes when editing news
Status: RESOLVED DUPLICATE of bug 29254
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All Linux
: P5 - low trivial (vote)
Assignee: Bugs List
QA Contact: Testopia
Depends on:
Reported: 2021-10-19 14:56 UTC by Florian
Modified: 2021-10-22 12:25 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:

Date change image (15.84 KB, image/png)
2021-10-19 14:56 UTC, Florian

Note You need to log in before you can comment on or make changes to this bug.
Description Florian 2021-10-19 14:56:34 UTC
Created attachment 126521 [details]
Date change image

When editing news, the publication (and expiration, if filled in) date inputs fields are automatically changed to a date in August 2026.
Even when setting up an article to be published later than that, it will still reverts to 2026 when opening up the edit page.

The date can be then edited and changed with no issues, but if someone just wanted to correct a typo in the article and didn't pay attention to the date, it's a very easy mistake to make.

Steps to reproduce :
1/ In Tools > News, create a news article with any kind of content
2/ Save it : it should show the publication date you specified (or the current date if you left it blank)
3/ Try to edit it : the publishing date input should automatically be set to a random date in August 2026. If you also specified an expiration date, it seems to also be set to that same random date.
Comment 1 Erica Rohlfs 2021-10-21 19:51:20 UTC
I cannot recreate this situation on the 21.05 db I'm using. I tried recreating it with Display Location: All, Librarian Interface, and OPAC news (en). I also tested selecting all library branches and a specific branch. I initially did not set an expiration date. When I did set an expiration date, the date I set remained. I also tested editing in the text box versus using source code. Are there further constraints I should use to replicate?
Comment 2 Erica Rohlfs 2021-10-21 19:57:36 UTC
Noting that I also just tested to see if I could recreate this issue with system preference NewsToolEditor set to "a text editor (CodeMirror)" instead of WYSIWYG. Koha still retained the set dates.
Comment 3 Florian 2021-10-22 08:02:34 UTC
It seems to be linked to the dateformat preferences. That bug does not appear when using the iso format (yyyy-mm-dd). Other format will still glitch but change the 'wrong' date (for instance, dd/mm/yyyy sets my edited dates to January 2021)

My work environment is french so it might be a glitch due to javascript and the browser.
Comment 4 Jonathan Druart 2021-10-22 12:25:35 UTC
Is your branch up-to-date?

Looks like a duplicate of bug 29254. Please reopen if the problem persists.

*** This bug has been marked as a duplicate of bug 29254 ***