Bug 33567: Add a dbrev for installation with empty pref

To keep current behavior, we can copy the removed fallback
into the syspref value in case someone might have cleared the pref.

Note: We are not restoring deleted prefs here; that is a data problem
outside the scope of this report. A regular installation should always
have this pref.

Test plan:
Run updatedatabase.pl
Bonus: Clear the pref Reference_NFL_Statuses and run again, verify that
the pref has changed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2023-04-20 06:52:50 +00:00 committed by Tomas Cohen Arazi
parent 69bce3a706
commit 17704ae233
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
use Modern::Perl;
return {
bug_number => 33567,
description => "Replace empty Reference_NFL_Statuses pref",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
my $rv = $dbh->do(q{
UPDATE systempreferences SET value='1|2'
WHERE variable = 'Reference_NFL_Statuses' AND COALESCE(value,'')=''
});
say $out "Updated preference Reference_NFL_Statuses to default"
if $rv && $rv == 1;
},
};