From 9205321bf5cbc856607e46b529c41f2fb3613996 Mon Sep 17 00:00:00 2001 From: Lisette Scheer Date: Mon, 21 Apr 2025 16:01:54 +0000 Subject: [PATCH] Bug 20747: DB Rev This patch adds a DB rev to update the system preference in existing installations. # Please enter the commit message for your changes. Lines starting Signed-off-by: Jason Robb Signed-off-by: Brendan Lawlor --- ..._20747-updatelocalholdspriority_syspref.pl | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl diff --git a/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl b/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl new file mode 100644 index 0000000000..517f554697 --- /dev/null +++ b/installer/data/mysql/db_revs/bug_20747-updatelocalholdspriority_syspref.pl @@ -0,0 +1,25 @@ +use Modern::Perl; + +return { + bug_number => "20747", + description => "Allow LocalHoldsPriority to fill by hierarchical groups system rather than individual library ", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + my $local_holds_priority = C4::Context->preference('LocalHoldsPriority'); + + # Do you stuffs here + $dbh->do( + q{ + UPDATE systempreferences + SET options='GiveLibrary|None|GiveLibraryGroup|GiveLibraryAndGroup', + value=CASE value WHEN '1' THEN 'GiveLibrary' ELSE 'None' END, + type="Choice" + WHERE variable="LocalHoldsPriority" + 'Enables the LocalHoldsPriority feature', 'None' 'Choice'), + }, + ); + + say $out "Updated system preference 'LocalHoldsPriority'"; + }, +}; -- 2.39.5