Bug 13188: (RM follow-up) Several fixes on db changes

Several issues with the atomic update:
 - File must to be .pl
 - File must be executable : chmod a+x
 - Syspref type is 'free' not 'multiple'

Small addition in atomic update:
I've added a print of syspref name and value,
this can be usefull for upgrade logs.

Also a minor issue in installer/data/mysql/mandatory/sysprefs.sql :
The description whas different from the atomic update.
I choose that atomic update is correct.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Fridolin Somers 2021-12-10 19:33:29 -10:00
parent 66058aa8e8
commit 5985d13e7a
2 changed files with 11 additions and 6 deletions

View File

@ -7,10 +7,15 @@ return {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
$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
});
SELECT 'PatronSelfModificationMandatoryField', value, NULL, 'Define the required fields when a patron is editing their information via the OPAC','free'
FROM (SELECT value FROM systempreferences WHERE variable='PatronSelfRegistrationBorrowerMandatoryField') tmp
});
my ($syspref_value) = $dbh->selectrow_array(q{
SELECT value FROM systempreferences WHERE variable='PatronSelfModificationMandatoryField'
});
say $out "Added new system preference 'PatronSelfModificationMandatoryField' with value '$syspref_value'";
},
}
}

View File

@ -514,7 +514,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'),
('patronimages','0',NULL,'Enable patron images for the staff interface','YesNo'),
('PatronRemovalDelay','',NULL,'Delay for removing anonymized patrons', 'Integer'),
('PatronSelfModificationMandatoryField','',NULL,'Name the fields you don\'t want to be required when a patron is editing their information via the OPAC.','free'),
('PatronSelfModificationMandatoryField','',NULL,'Define the required fields when a patron is editing their information via the OPAC','free'),
('PatronSelfModificationBorrowerUnwantedField','',NULL,'Name the fields you don\'t want to display when a patron is editing their information via the OPAC.','free'),
('PatronSelfRegistration','0',NULL,'If enabled, patrons will be able to register themselves via the OPAC.','YesNo'),
('PatronSelfRegistrationAdditionalInstructions','','','A free text field to display additional instructions to newly self registered patrons.','free'),