From 7c260de1678b88a278b87f1de5c0d764d674c558 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 (cherry picked from commit e8e7ea352ef237555ee4d47c98feb879f3eb9e31) Signed-off-by: Martin Renvoize --- C4/Serials.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/C4/Serials.pm b/C4/Serials.pm index 91498ee262..7f722f4c09 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1371,6 +1371,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