Bugzilla – Attachment 131170 Details for
Bug 30196
Odd number of elements warning caused by dt_from_string
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30196: Odd number of elements warning caused by dt_from_string
Bug-30196-Odd-number-of-elements-warning-caused-by.patch (text/plain), 1.13 KB, created by
Blou
on 2022-02-28 17:18:10 UTC
(
hide
)
Description:
Bug 30196: Odd number of elements warning caused by dt_from_string
Filename:
MIME Type:
Creator:
Blou
Created:
2022-02-28 17:18:10 UTC
Size:
1.13 KB
patch
obsolete
>From 434e1549ce85a06876be644dec0301dcea683857 Mon Sep 17 00:00:00 2001 >From: Blou <blou@inlibro.com> >Date: Mon, 28 Feb 2022 12:12:38 -0500 >Subject: [PATCH] Bug 30196: Odd number of elements warning caused by > dt_from_string > >Koha/DateUtils' dt_from_string is a sub expected to return a scalar, but >does not in all case. > >In one instance, tt simply return... nothing, which cause one common call >output_pref( { dt => dt_from_string( $serinfo->{$d} ), dateonly => 1 } ); >to output a warning. > >Simply returning undef instead will solve the issue. >--- > Koha/DateUtils.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm >index 58fec0bef9..6413f37305 100644 >--- a/Koha/DateUtils.pm >+++ b/Koha/DateUtils.pm >@@ -57,7 +57,7 @@ to the system preferences. If the date string is empty DateTime->now is returned > sub dt_from_string { > my ( $date_string, $date_format, $tz ) = @_; > >- return if $date_string and $date_string =~ m|^0000-0|; >+ return undef if $date_string and $date_string =~ m|^0000-0|; > > my $do_fallback = defined($date_format) ? 0 : 1; > my $server_tz = C4::Context->tz; >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30196
:
131170
|
136656