From 3c24667a518810aa8c56fd70f06392314e373f58 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 5 May 2023 15:08:24 +0000 Subject: [PATCH] Bug 32911: (follow-up) Only move config value from koha-conf.xml if it exists Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/bug_32911.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_32911.pl b/installer/data/mysql/atomicupdate/bug_32911.pl index 44176d1a05..d9d941a57b 100755 --- a/installer/data/mysql/atomicupdate/bug_32911.pl +++ b/installer/data/mysql/atomicupdate/bug_32911.pl @@ -10,11 +10,14 @@ return { my $xml_config = C4::Context->config("interlibrary_loans"); my $existing_partner_code = $xml_config->{partner_code}; - $dbh->do(qq{ - INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) - VALUES ('ILLPartnerCode', '$existing_partner_code', NULL, 'Patrons from this patron category will be used as partners to place ILL requests with', 'free'); - }); - - say $out "Moved value of partner_code in koha-conf.xml into new system preference 'ILLPartnerCode'"; + if ( $existing_partner_code ) { + $dbh->do( + qq{ + INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) + VALUES ('ILLPartnerCode', '$existing_partner_code', NULL, 'Patrons from this patron category will be used as partners to place ILL requests with', 'free'); + } + ); + say $out "Moved value of partner_code in koha-conf.xml into new system preference 'ILLPartnerCode'"; + } } }; -- 2.39.5