From 7c2ff87d0ec5ac9494904e69174c76afdc9dce8c Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Wed, 22 Sep 2021 18:42:07 +0200 Subject: [PATCH] Bug 18138: fix atomic update and system preference type --- admin/preferences.pl | 2 +- ...it-biblio-marc-modification-template-syspref.pl | 14 ++++++++++++++ ...t-biblio-marc-modification-template-syspref.sql | 1 - installer/data/mysql/mandatory/sysprefs.sql | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.pl delete mode 100644 installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql diff --git a/admin/preferences.pl b/admin/preferences.pl index 8b5596cc837..80590adc490 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -103,7 +103,7 @@ sub _get_chunk { } elsif ( $options{choices} eq 'patron-categories' ) { $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search->as_list }; $add_blank = 1; - } elsif ( $options{choices} eq 'modification-templates' ) { + } elsif ( $options{choices} eq 'marcModTemplates' ) { $options{choices} = { map { $_->template_id => $_->name } Koha::MarcModificationTemplates->search }; $add_blank = 1; } else { diff --git a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.pl b/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.pl new file mode 100644 index 00000000000..6fd8b901d78 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "18138", + description => "Add system preference", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + # Do you stuffs here + $dbh->do(q{INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'marcModTemplates')}); + # Print useful stuff here + say $out "System preference added"; + }, +} diff --git a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql b/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql deleted file mode 100644 index e9b564a55ab..00000000000 --- a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql +++ /dev/null @@ -1 +0,0 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates'); diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index e2fb400e921..ef820be97d7 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -633,7 +633,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('RoutingListNote','To change this note edit RoutingListNote system preference.','70|10','Define a note to be shown on all routing lists','Textarea'), ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), ('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'), -('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates'), +('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'marcModTemplates'), ('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), ('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'), ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded