Bug 17257: Fix add/edit patrons under MySQL 5.7

If no guarantor is defined the patron won't be added/modified and an
error will be raised:

DBD::mysql::st execute failed: Incorrect integer value: '' for column
'guarantorid'

Test plan:
Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES)
Create a patron without guarantor

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>

Tested with MariaDB 10.0.30 (sql_mode='STRICT_TRANS_TABLES')
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2016-09-06 10:12:20 +01:00 committed by Kyle M Hall
parent 3e1f21ae0d
commit 7200710045
1 changed files with 1 additions and 0 deletions

View File

@ -494,6 +494,7 @@ sub AddMember {
$data{'dateofbirth'} = undef if ( not $data{'dateofbirth'} );
$data{'debarred'} = undef if ( not $data{'debarred'} );
$data{'sms_provider_id'} = undef if ( not $data{'sms_provider_id'} );
$data{'guarantorid'} = undef if ( not $data{'guarantorid'} );
# get only the columns of Borrower
# FIXME Do we really need this check?