If the TimeFormat system preference is set to 12-hour format the about page explodes with an error, "Template process failed: undef error - Validation failed for type named Hour declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.24/DateTime/Types.pm) at line 101 in sub named (eval) with value 24"
Created attachment 105412 [details] [review] Bug 25617: Pass 24hr to output_pref This patch changes the date formatting function used to create the current_date_and_time variable by adding '24hr' as the timeformat parameter. This avoids an error when the TimeFormat preference is set to 12hr. To test, apply the patch and go to the "About" page in the staff interface. It should work correctly. The "Date and time" information under the "Server information" tab should be correct.
Template process failed: undef error - Validation failed for type named Hour declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.24/DateTime/Types.pm) at line 101 in sub named (eval) with valu e 24 Trace begun at Specio::Exception->new line 57 Specio::Exception::throw('Specio::Exception', 'message', 'Validation failed for type named Hour declared in package DateTime::Types (/usr/lib/x86_64-linux-gnu/perl5/5.24/DateTime/Types.pm) at line 101 in sub nam ed (eval) with value 24', 'type', 'Specio::Constraint::Simple=HASH(0x5602f411a6f8)', 'value', 24) called at (eval 217) line 126 DateTime::_check_new_params('month', 05, 'day', 28, 'second', 0, 'year', 2020, 'minute', 49, 'hour', 24, 'time_zone', 'floating') called at /usr/lib/x86_64-linux-gnu/perl5/5.24/DateTime.pm line 165 DateTime::new('DateTime', 'month', 05, 'day', 28, 'second', 0, 'year', 2020, 'minute', 49, 'hour', 24, 'time_zone', 'floating') called at /kohadevbox/koha/Koha/DateUtils.pm line 200 Koha::DateUtils::dt_from_string('2020-05-28 12:49 PM', 'iso') called at /kohadevbox/koha/Koha/Template/Plugin/KohaDates.pm line 34 Koha::Template::Plugin::KohaDates::filter('Koha::Template::Plugin::KohaDates=HASH(0x560309b36c28)', '2020-05-28 12:49 PM', 'ARRAY(0x5603099fe908)', 'HASH(0x5603098a3928)') called at /usr/lib/x86_64-linux-gnu/per l5/5.24/Template/Plugin/Filter.pm line 82 Template::Plugin::Filter::__ANON__('2020-05-28 12:49 PM') called at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt line 127 eval {...} at /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt line 18 Template::Provider::__ANON__('Template::Context=HASH(0x56030151f128)') called at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Document.pm line 163 eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Document.pm line 161 Template::Document::process('Template::Document=HASH(0x560309b36880)', 'Template::Context=HASH(0x56030151f128)') called at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Context.pm line 351 eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Context.pm line 321 Template::Context::process('Template::Context=HASH(0x56030151f128)', 'Template::Document=HASH(0x560309b36880)') called at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Service.pm line 94 eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.24/Template/Service.pm line 91 Template::Service::process('Template::Service=HASH(0x5602fe764610)', '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt', 'HASH(0x5603097ff4b0)') called at /usr/lib/x86_64-linux-gnu/perl5/5.24/Te mplate.pm line 66 Template::process('Template=HASH(0x560301521550)', '/kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/about.tt', 'HASH(0x5603097ff4b0)', 'SCALAR(0x5602f7c2a138)') called at /kohadevbox/koha/C4/Templates.p m line 122
What OS? I cannot reproduce on Stretch
Maybe something else actually.
It's only happening when hour=12. I am working on it.
Created attachment 105417 [details] [review] Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0 There was an error in the precedent code, in 12hr format, 12PM is actually 00:00
Created attachment 105418 [details] [review] Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0 There was an error in the precedent code, in 12hr format, 12PM is actually 00:00
Upping severity, not sure how big this is for TimeFormat=12hr
Created attachment 105422 [details] [review] Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0 There was an error in the precedent code, in 12hr format, 12PM is actually 00:00 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 105423 [details] [review] Bug 25617: (QA follow-up) Add responses to tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 105431 [details] [review] Bug 25617: (bug 25133 follow-up) 12 PM is not 24 but 0 There was an error in the precedent code, in 12hr format, 12PM is actually 00:00 Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Created attachment 105432 [details] [review] Bug 25617: (QA follow-up) Add responses to tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Pushed to master for 20.05
backported to 19.11.x for 19.11.07
Backported to 19.05.x branch for 19.05.12