]> git.koha-community.org Git - koha.git/commit
Bug 26365: Remove comparison with 0000-00-00 for datecancellationprinted
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Sep 2020 09:58:14 +0000 (11:58 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 11 Sep 2020 07:56:56 +0000 (09:56 +0200)
commit3fb268cd4bb6723daa72ce46c08cefc02e788acc
treeee3c5d38bd344dfe51d70f1eec81815709f08a4c
parenta1644cbf298d2178b57b7f4d5163f13e2d4c39ee
Bug 26365: Remove comparison with 0000-00-00 for datecancellationprinted

Using MySQL 8:
t/db_dependent/Koha/Acquisition/Order.t .. 10/11 No method count found for Koha::Acquisition::Orders DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Incorrect DATE value: '0000-00-00' [for Statement "SELECT COUNT( * ) FROM `aqorders` `me` WHERE ( ( ( `datecancellationprinted` IS NULL OR `datecancellationprinted` = ? ) AND `ordernumber` IN ( ?, ?, ? ) ) )" with ParamValues: 0='0000-00-00', 1=23, 2=24, 3=25] at /kohadevbox/koha/Koha/Objects.pm line 597

We must remove the comparison with 0000-00-00

Highlighted by bug 23166.

I wanted to provide a DB rev but we (obviously) cannot:
MySQL [koha_kohadev]> UPDATE aqorders SET datecancellationprinted=NULL WHERE datecancellationprinted="0000-00-00";
ERROR 1292 (22007): Incorrect date value: '0000-00-00' for column 'datecancellationprinted' at row 1

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Acquisition/Orders.pm