From 0479537be6df821f7b3ca758f93edf04f9b62f8c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Feb 2021 11:46:54 +0100 Subject: [PATCH] Bug 27634: Update PatronSelfRegistrationBorrowerUnwantedField's value Signed-off-by: David Nind Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_27634.perl | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_27634.perl diff --git a/installer/data/mysql/atomicupdate/bug_27634.perl b/installer/data/mysql/atomicupdate/bug_27634.perl new file mode 100644 index 00000000000..b3c2d943d7d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27634.perl @@ -0,0 +1,20 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + for my $f ( qw( categorycode dateexpiry ) ) { + my ( $exists ) = $dbh->selectrow_array(qq{ + SELECT value from systempreferences + WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" + AND value LIKE "%$f%" + }); + unless ( $exists ) { + $dbh->do(q{ + UPDATE systempreferences + SET value = CONCAT(value, IF(value<>'','|',''), ?) + WHERE variable="PatronSelfRegistrationBorrowerUnwantedField" + }, undef, $f); + } + } + + NewVersion( $DBversion, 27634, "Add categorycode and dateexpiry to PatronSelfRegistrationBorrowerUnwantedField"); +} -- 2.25.1