From 5db2d54a0f8f9fe991cb223052a96ea7fa7ebb27 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 10 Jun 2022 12:10:28 +0000 Subject: [PATCH] Bug 30025: DB update Signed-off-by: AFHDubCoLib Signed-off-by: Martin Renvoize Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_30025.pl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30025.pl diff --git a/installer/data/mysql/atomicupdate/bug_30025.pl b/installer/data/mysql/atomicupdate/bug_30025.pl new file mode 100755 index 0000000000..d82246f49f --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_30025.pl @@ -0,0 +1,21 @@ +use Modern::Perl; + +return { + bug_number => "30025", + description => "Split and rename BiblioAddsAuthorities system preference", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + my $biblio_adds_authorities = C4::Context->preference('BiblioAddsAuthorities'); + # Do you stuffs here + $dbh->do(q{ + INSERT IGNORE INTO systempreferences + ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('AllowManualAuthorityEditing',?,NULL,'Allow manual entry in controlled fields during cataloging.','YesNo'), + ('AutoLinkBiblios',?,NULL,'If enabled, link biblio to authorities on creation and edit','YesNo') + },undef,($biblio_adds_authorities,$biblio_adds_authorities)); + say $out "Added AllowManualAuthorityEditing and AutoLinkBiblios"; + $dbh->do(q{DELETE FROM systempreferences WHERE variable="BiblioAddsAuthorities";}); + say $out "BiblioAddsAuthorities removed"; + }, +}; -- 2.39.5