Bug 30706 - DateFormat change only takes effect after a restart of services
Summary: DateFormat change only takes effect after a restart of services
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
: 30711 (view as bug list)
Depends on: 30514
Blocks:
  Show dependency treegraph
 
Reported: 2022-05-06 08:35 UTC by Katrin Fischer
Modified: 2023-12-28 20:43 UTC (History)
4 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:
22.05.00


Attachments
Bug 30706: Fix space in check for dateformat preference (2.88 KB, patch)
2022-05-06 13:49 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30706: Fix space in check for dateformat preference (2.92 KB, patch)
2022-05-06 16:19 UTC, David Nind
Details | Diff | Splinter Review
Bug 30706: Fix space in check for dateformat preference (2.98 KB, patch)
2022-05-09 02:44 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-05-06 08:35:26 UTC
This was found while testing bug 30514. To test:

- Edit any patron
- Change the date of birth, verify:
  - Hint: (MM/DD/YYYY) 
  - Adding a date, it displays in this format in the input field
- Change Dateformat system prefernce to DD.MM.YYYY
- Edit the patron again, Verify:
  - Hint: (TT.MM.YYYY)
  - Adding/updating the date it still shows in the previous format
- Do a restart_all or equivalent on your test environment
- Verify the date now has the correct format when edited

A system preference change should take immediate effect. There should be no need to restart anything.
Comment 1 Jonathan Druart 2022-05-06 09:00:52 UTC
There is a bad space there:
  var dateformat_pref = "[% Koha.Preference('dateformat ') | html %]";
Comment 2 Owen Leonard 2022-05-06 13:46:18 UTC
*** Bug 30711 has been marked as a duplicate of this bug. ***
Comment 3 Owen Leonard 2022-05-06 13:49:03 UTC
Created attachment 134739 [details] [review]
Bug 30706: Fix space in check for dateformat preference

This patch fixes the calendar.inc includes in both staff and OPAC in
order to remove a typo: An extra space in the check for the "dateformat"
system preference.

The result of this error is that changes to the dateformat system
preference will not be correctly applied to Koha without a restart.

To reproduce the problem start the process of creating a new patron.

 - In the date of birth field, select a date. The format of the date
   inserted should match your current dateformat system preference.
 - Go to Administration -> System preferences and update dateformat to
   something different.
 - Go back to the patron creation form (refresh it if necessary).
 - The hint under the Date of birth field will match your updated system
   preference, but when you pick a date using the calendar widget it
   will still be formatted according to the old value of dateformat.

To test the fix, apply the patch and run through the same steps above.
A change the dateformat preference should be immediately reflected in
the functionality of the calendar widget.
Comment 4 David Nind 2022-05-06 16:19:53 UTC
Created attachment 134752 [details] [review]
Bug 30706: Fix space in check for dateformat preference

This patch fixes the calendar.inc includes in both staff and OPAC in
order to remove a typo: An extra space in the check for the "dateformat"
system preference.

The result of this error is that changes to the dateformat system
preference will not be correctly applied to Koha without a restart.

To reproduce the problem start the process of creating a new patron.

 - In the date of birth field, select a date. The format of the date
   inserted should match your current dateformat system preference.
 - Go to Administration -> System preferences and update dateformat to
   something different.
 - Go back to the patron creation form (refresh it if necessary).
 - The hint under the Date of birth field will match your updated system
   preference, but when you pick a date using the calendar widget it
   will still be formatted according to the old value of dateformat.

To test the fix, apply the patch and run through the same steps above.
A change the dateformat preference should be immediately reflected in
the functionality of the calendar widget.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Victor Grousset/tuxayo 2022-05-09 02:44:28 UTC
Created attachment 134770 [details] [review]
Bug 30706: Fix space in check for dateformat preference

This patch fixes the calendar.inc includes in both staff and OPAC in
order to remove a typo: An extra space in the check for the "dateformat"
system preference.

The result of this error is that changes to the dateformat system
preference will not be correctly applied to Koha without a restart.

To reproduce the problem start the process of creating a new patron.

 - In the date of birth field, select a date. The format of the date
   inserted should match your current dateformat system preference.
 - Go to Administration -> System preferences and update dateformat to
   something different.
 - Go back to the patron creation form (refresh it if necessary).
 - The hint under the Date of birth field will match your updated system
   preference, but when you pick a date using the calendar widget it
   will still be formatted according to the old value of dateformat.

To test the fix, apply the patch and run through the same steps above.
A change the dateformat preference should be immediately reflected in
the functionality of the calendar widget.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 6 Victor Grousset/tuxayo 2022-05-09 02:44:56 UTC
Works, qa script happy, code looks good, passing QA :)
Comment 7 Fridolin Somers 2022-05-09 20:03:16 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄