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 <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-08 14:03:37 +01:00 committed by Martin Renvoize
parent 508a5addf1
commit 5e5c47ea30
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 2 deletions

View File

@ -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);