From 5e5c47ea300b7eb34cbcd3e71ff4a1ac9a3eaa38 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 Nov 2019 14:03:37 +0100 Subject: [PATCH] Bug 24002: Incorrect DATE value: '0000-00-00' in C4/Serials.pm DBD::mysql::st execute failed: Incorrect DATE value: '0000-00-00' [for Statement "SELECT serialid,serialseq, status, planneddate, publisheddate, publisheddatetext, notes, routingnotes FROM serial WHERE subscriptionid = ? AND status IN ( 2,4,41,42,43,44,5 ) ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC " with ParamValues: 0=8] at /kohadevbox/koha/C4/Serials.pm line 688. Signed-off-by: Martin Renvoize --- C4/Serials.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 1841397dc4..dc0d841fdf 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -660,7 +660,7 @@ sub GetSerials { publisheddatetext, planneddate,notes, routingnotes FROM serial WHERE subscriptionid = ? AND status NOT IN ( $statuses ) - ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC"; + ORDER BY IF(publisheddate IS NULL,planneddate,publisheddate) DESC"; my $sth = $dbh->prepare($query); $sth->execute($subscriptionid); @@ -682,7 +682,7 @@ sub GetSerials { FROM serial WHERE subscriptionid = ? AND status IN ( $statuses ) - ORDER BY IF(publisheddate<>'0000-00-00',publisheddate,planneddate) DESC + ORDER BY IF(publisheddate IS NULL,planneddate,publisheddate) DESC "; $sth = $dbh->prepare($query); $sth->execute($subscriptionid); -- 2.39.5