From 9031702e159af14eccbb46cd660beb6dad9ab493 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 6 May 2019 13:34:19 -0500 Subject: [PATCH] Bug 22812: Fix new subscription with strict sql modes With sql_strict_modes turned on, if you try to create a new subscription you will get: Incorrect integer value: '' for column '$INT_COLUMN' at row 1 --- C4/Serials.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Serials.pm b/C4/Serials.pm index f8c17b9189..1f5a87091e 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1373,6 +1373,11 @@ sub NewSubscription { ) = @_; my $dbh = C4::Context->dbh; + $_ ||= undef # Set to undef for integer values, not empty string + for ( + $aqbooksellerid, $lastvalue1, $innerloop1, $lastvalue2, + $innerloop2, $lastvalue3, $innerloop3, + ); #save subscription (insert into database) my $query = qq| INSERT INTO subscription -- 2.11.0