With the pushing of Bug 18299, we no longer have a quick way of checking the timezone of the Perl and MySQL connection. We should add some code to the About Koha page to show this info.
Created attachment 72214 [details] [review] Bug 18674: Added timezone information to about page Before patch: No timezone section After patch: timezone section at bottom of Server information tab. Actual is what is being used. Config overrides environment variables. So if there is confusion why the environment variables aren't working, it will be visible why.
It should be noted that I had to tweak 20123 to get it to a usable state for this, so sign off can't happen immediately.
Created attachment 73533 [details] [review] Bug 18674: Added timezone information to about page Before patch: No timezone section After patch: timezone section at bottom of Server information tab. Actual is what is being used. Config overrides environment variables. So if there is confusion why the environment variables aren't working, it will be visible why. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 73534 [details] [review] Bug 18674: Follow up on missing TZ SetEnv for plack It should also be noted that /etc/apache2/sites-enabled/{configuration file} should also contain: RequestHeader add X-Koha-SetEnv "TZ {timezone}" Where {timezone} is the desired instance timezone. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Created attachment 73700 [details] [review] Bug 18674: Added timezone information to about page Before patch: No timezone section After patch: timezone section at bottom of Server information tab. Actual is what is being used. Config overrides environment variables. So if there is confusion why the environment variables aren't working, it will be visible why. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 73701 [details] [review] Bug 18674: Follow up on missing TZ SetEnv for plack It should also be noted that /etc/apache2/sites-enabled/{configuration file} should also contain: RequestHeader add X-Koha-SetEnv "TZ {timezone}" Where {timezone} is the desired instance timezone. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 73702 [details] [review] Bug 18674: Style changes to match other entries Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 73720 [details] [review] Bug 18674: TZ error handling This patch adds C4::Context->timezone bad timezone handling. The calculated 'effective' timezone is tested with the right tool and a fallback to 'local' is added. A warning is printed in the logs. A test for this is added to about.pl too, along with the right warning messages in case of problems. Tests are added for both invalid TZ and to make sure the warning is raised. To test: - Apply the patch - Run: $ kshell k$ prove t/timezones.t => SUCCESS: All tests pass Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Use of uninitialized value $config_timezone in string ne at /home/vagrant/kohaclone/about.pl line 71. Use of uninitialized value $config_timezone in string eq at /home/vagrant/kohaclone/about.pl line 76. Use of uninitialized value $env_timezone in string ne at /home/vagrant/kohaclone/about.pl line 76. Also, should not we display the date and time, could be a relevant information (especially when tz=local).
Created attachment 74024 [details] [review] Bug 18674: (QA follow-up) Add date and time This patch adds current date and time, formatted as configured. It makes the timezone name be displayed the system uses it (important for the 'local' use case). It removes some warnings too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 74026 [details] [review] Bug 18674: (QA follow-up) Add date and time This patch adds current date and time, formatted as configured. It makes the timezone name be displayed the system uses it (important for the 'local' use case). It removes some warnings too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 74036 [details] [review] Bug 18674: (QA follow-up) Add date and time This patch adds current date and time, formatted as configured. It makes the timezone name be displayed the system uses it (important for the 'local' use case). It removes some warnings too. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
It would be good to write something about this new entry on the wiki.
Pushed to master for 18.05, thanks to everybody involved!
Enhancement on feature, not backported for 17.11.x
It's a shame this isn't backported to at least 17.05, since 17.05 and 17.11 don't have an easy way of verifying TZ settings.
(In reply to David Cook from comment #16) > It's a shame this isn't backported to at least 17.05, since 17.05 and 17.11 > don't have an easy way of verifying TZ settings. This one needs some work to be suitable for the old stable releases. You better talk to the release maintainers. If you need it.
(In reply to Tomás Cohen Arazi from comment #17) > (In reply to David Cook from comment #16) > > It's a shame this isn't backported to at least 17.05, since 17.05 and 17.11 > > don't have an easy way of verifying TZ settings. > > This one needs some work to be suitable for the old stable releases. You > better talk to the release maintainers. If you need it. In that case, I'd say reverting https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18299 for 17.05 and 17.11 might be a better idea. I ended up just copying admin/env_tz_test.pl from an older version of Koha and ran that instead for the setup of the timezone and then deleted it again. I imagine anyone who needs to check for 17.05 and 17.11 would just do the same thing.