From e8e7ea352ef237555ee4d47c98feb879f3eb9e31 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 Signed-off-by: Liz Rea Signed-off-by: Marcel de Rooy Signed-off-by: Michal Denar Signed-off-by: Michal Denar Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- 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.39.5