From ebb5d101d7116c641d7fdc8bc911b59a08722723 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 24 Sep 2021 16:26:14 +0100 Subject: [PATCH] Bug 13188: (QA follow-up) Modernise atomicupdate --- ...elfModificationMandatoryField_syspref.perl | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl b/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl index 0e9e76b3583..43a3f5105d5 100644 --- a/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl +++ b/installer/data/mysql/atomicupdate/bug_13188_add_PatronSelfModificationMandatoryField_syspref.perl @@ -1,9 +1,16 @@ -$DBversion = 'XXX'; # will be replaced by the RM -if( CheckVersion( $DBversion ) ) { - $dbh->do(q{ - INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) - SELECT 'PatronSelfModificationMandatoryField', value, NULL, 'Define the required fields when a patron is editing their information via the OPAC','multiple' - FROM (SELECT value FROM systempreferences WHERE variable="PatronSelfRegistrationBorrowerMandatoryField") tmp - }); - NewVersion($DBversion, 13188, "Allow configuration of required fields when a patron is editing their information via the OPAC"); +use Modern::Perl; + +return { + bug_number => "13188", + description => "Allow configuration of required fields when a patron is editing their information via the OPAC", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + SELECT 'PatronSelfModificationMandatoryField', value, NULL, 'Define the required fields when a patron is editing their information via the OPAC','multiple' + FROM (SELECT value FROM systempreferences WHERE variable="PatronSelfRegistrationBorrowerMandatoryField") tmp + }); + }, } -- 2.20.1