From 3d7c543ab1073d47e57dddc436c1702575ae5ac8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 20 Apr 2023 06:52:50 +0000 Subject: [PATCH] Bug 33567: Add a dbrev for installation with empty pref Content-Type: text/plain; charset=utf-8 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 --- installer/data/mysql/atomicupdate/bug_33567.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_33567.pl diff --git a/installer/data/mysql/atomicupdate/bug_33567.pl b/installer/data/mysql/atomicupdate/bug_33567.pl new file mode 100755 index 0000000000..70f424ecbf --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_33567.pl @@ -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; + }, +}; -- 2.30.2