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 <wizzyrea@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Michal Denar <black23@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2019-05-06 13:34:19 -05:00 committed by Nick Clemens
parent 3b877cc240
commit e8e7ea352e
1 changed files with 5 additions and 0 deletions

View File

@ -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