From 088ff00c2b5834a0d9d86a12fe2ad261e61f7d96 Mon Sep 17 00:00:00 2001 From: Lucas Montoya Date: Mon, 19 Jan 2026 22:25:49 -0300 Subject: [PATCH] Bug 41663: Update system preferences default values This patch replace default values from '' to '0' for all system preferences which type is 'YesNo' avoiding warning messages to be displayed in 'About Koha' page. To test: 1 - Initialize a fresh instance of ktd, using main as the default branch in the Koha repository. 2 - Run git reset --hard 24.11.x. 3 - Run ktd --shell to enter the container. 4 - Run reset_all to downgrade the database to 24.11. 5 - Exit the shell and run git reset --hard origin/main to switch back to the latest version of Koha. 6 - Run ktd --shell again to re-enter the container. 7 - Run updatedatabase && yarn build to apply the upgrade. 8 - Go to localhost:8081 (or the assigned port for the admin interface) -> More -> 'About Koha' -> 'System information' and you should be able to see the warning messages 9 - Repeat steps 1-4 10 - Exit the shell and apply this patch 11 - Repeat steps 6-8 12 - Congrats! You shouldn't see the related warnings anymore! --- .../data/mysql/atomicupdate/bug_41663.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_41663.pl diff --git a/installer/data/mysql/atomicupdate/bug_41663.pl b/installer/data/mysql/atomicupdate/bug_41663.pl new file mode 100755 index 0000000000..173e7d746f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_41663.pl @@ -0,0 +1,19 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "41663", + description => "Change default values for sysprefs from '' to '0' where type is 'YesNo'", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{UPDATE systempreferences SET value = 0 WHERE type = 'YesNo' AND value = ''}, + undef + ); + say $out + "Updated system preference default value for system preferences with empty string value and type 'YesNo'"; + } +}; + -- 2.52.0