Bug 27634: Update PatronSelfRegistrationBorrowerUnwantedField's value

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2021-02-05 11:46:54 +01:00 committed by Tomas Cohen Arazi
parent 6ea09bbe0a
commit 6c176f323b
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -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");
}