Bug 30025: DB update

Signed-off-by: AFHDubCoLib <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2022-06-10 12:10:28 +00:00 committed by Tomas Cohen Arazi
parent 3d0015fe69
commit 5db2d54a0f
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 21 additions and 0 deletions

View File

@ -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";
},
};