From ec2e2a8f53f66bb6791ac849fc4aa71fbde45106 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Fri, 11 Jul 2025 18:19:30 +0000 Subject: [PATCH] Bug 32432: Database update --- .../data/mysql/atomicupdate/bug_32432.pl | 36 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 installer/data/mysql/atomicupdate/bug_32432.pl diff --git a/installer/data/mysql/atomicupdate/bug_32432.pl b/installer/data/mysql/atomicupdate/bug_32432.pl new file mode 100755 index 00000000000..507909da731 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_32432.pl @@ -0,0 +1,36 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "32432", + description => "Convert the Syndetics from 1/0 to multiple", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + my ($SyndeticsAuthorNotes) = $dbh->selectrow_array( + q{ + SELECT CASE + WHEN value = '1' THEN 'opac' + WHEN value = '0' THEN '' + ELSE value + END + FROM systempreferences + WHERE variable = 'SyndeticsAuthorNotes' + } + ); + + $dbh->do( + q{ + UPDATE systempreferences + SET type = 'multiple', + options = 'staff|opac', + value = ? + WHERE variable = 'SyndeticsAuthorNotes' + }, undef, $SyndeticsAuthorNotes + ); + + say $out "Updated SyndeticsAuthorNotes system preference"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index f9f419c39d0..1ee286a79a7 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -792,7 +792,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('SuspensionsCalendar','noSuspensionsWhenClosed','ignoreCalendar|noSuspensionsWhenClosed','Specify whether to use the Calendar in calculating suspension expiration','Choice'), ('SvcMaxReportRows','10',NULL,'Maximum number of rows to return via the report web service.','Integer'), ('SwitchOnSiteCheckouts','0',NULL,'Automatically switch an on-site checkout to a normal checkout','YesNo'), -('SyndeticsAuthorNotes','0','','Display Notes about the Author on OPAC from Syndetics','YesNo'), +('SyndeticsAuthorNotes','','staff|opac','Display Notes about the Author from Syndetics','multiple'), ('SyndeticsAwards','0','','Display Awards on OPAC from Syndetics','YesNo'), ('SyndeticsClientCode','0','','Client Code for using Syndetics Solutions content','free'), ('SyndeticsCoverImages','0','','Display Cover Images from Syndetics','YesNo'), -- 2.39.5