From d010878098c742a2c6060c8dba5800ab1bc7603e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 6 Sep 2016 10:12:20 +0100 Subject: [PATCH] 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 Tested with MariaDB 10.0.30 (sql_mode='STRICT_TRANS_TABLES') Signed-off-by: Julian Maurice Signed-off-by: Kyle M Hall (cherry picked from commit 720071004516ec4e119dc5ec7f9538b56313b186) Signed-off-by: Katrin Fischer (cherry picked from commit 63823bbfcd66191f88b5f9359b1a743e71d69348) Signed-off-by: Julian Maurice --- C4/Members.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Members.pm b/C4/Members.pm index fe40188849..6eff6d7a65 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -759,6 +759,7 @@ sub AddMember { # we don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00 $data{'dateofbirth'} = undef if( not $data{'dateofbirth'} ); $data{'debarred'} = undef if ( not $data{'debarred'} ); + $data{'guarantorid'} = undef if ( not $data{'guarantorid'} ); # get only the columns of Borrower my @columns = $schema->source('Borrower')->columns; -- 2.39.5