From 5050732b1f945189422c9de6d6d9cf5a74235f28 Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Thu, 29 Oct 2015 19:57:37 -0300 Subject: [PATCH] Bug 15087: make dt_from_string return undef for '0000-00-00' To test: 1) Reproduce problem in description 2) Apply the patch 3) Try again, no more problems I don't know if this could have side effects --- Koha/DateUtils.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Koha/DateUtils.pm b/Koha/DateUtils.pm index 7a98120..01e3342 100644 --- a/Koha/DateUtils.pm +++ b/Koha/DateUtils.pm @@ -53,7 +53,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|; $tz = C4::Context->tz unless $tz;; -- 1.9.1