Bug 20144: [sql_modes] Set default value for aqbasket.is_standing
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Feb 2018 18:36:27 +0000 (15:36 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 13 Feb 2018 16:58:50 +0000 (13:58 -0300)
Fix for:
Column 'is_standing' cannot be null

t/db_dependent/Koha/Acquisition/Booksellers.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Acquisition.pm

index 15a51dd..d7f0e25 100644 (file)
@@ -607,6 +607,8 @@ case the AcqCreateItem syspref takes precedence).
 
 sub ModBasketHeader {
     my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace, $is_standing, $create_items) = @_;
+
+    $is_standing ||= 0;
     my $query = qq{
         UPDATE aqbasket
         SET basketname=?, note=?, booksellernote=?, booksellerid=?, deliveryplace=?, billingplace=?, is_standing=?, create_items=?