From 30016e6cdcbfe293daf3175fb09be1d30933fa60 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Thu, 17 Sep 2020 16:35:10 +0200 Subject: [PATCH] Bug 18138: Rename system preference --- cataloguing/addbiblio.pl | 2 +- ...18138-edit-biblio-marc-modification-template-syspref.sql | 2 +- .../prog/en/modules/admin/preferences/cataloguing.pref | 2 +- svc/bib | 2 +- .../www/EditBiblioMarcModificationTemplatePreference.t | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 101b55fab3..41e93a4a0e 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -860,7 +860,7 @@ if ( $op eq "addbiblio" ) { # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { my $oldbibitemnum; - my $marc_modification_template_name = C4::Context->preference("EditBiblioMarcModificationTemplate"); + my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate"); if ($marc_modification_template_name) { my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates(); if ($template) { 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 index 0756e581b8..9ff01870ae 100644 --- 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 @@ -1 +1 @@ -INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('EditBiblioMarcModificationTemplate', '', '', 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free'); +INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', '', 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref index fc84636142..550bf5569f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref @@ -160,7 +160,7 @@ Cataloging: - ".
NOTE: Use a dollar sign between field and subfield like 123$a." - - Apply the MARC modification template with name - - pref: EditBiblioMarcModificationTemplate + - pref: SaveBiblioMarcModificationTemplate class: short - on records saved using the staff client simple MARC editor, advanced editor or HTTP API. Display: diff --git a/svc/bib b/svc/bib index d1cdc2d37e..09aba1d6e0 100755 --- a/svc/bib +++ b/svc/bib @@ -116,7 +116,7 @@ sub update_bib { } } - my $marc_modification_template_name = C4::Context->preference("EditBiblioMarcModificationTemplate"); + my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate"); if ($marc_modification_template_name) { my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates(); if ($template) { diff --git a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t index a8f67a5c19..6dd2f74874 100644 --- a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t +++ b/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t @@ -87,8 +87,8 @@ subtest 'Templates applied using simple and advanced MARC Editor' => sub { isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved'); is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio'); - my $old_template_preference = C4::Context->preference('EditBiblioMarcModificationTemplate'); - C4::Context->set_preference('EditBiblioMarcModificationTemplate', 'TEST'); + my $old_template_preference = C4::Context->preference('SaveBiblioMarcModificationTemplate'); + C4::Context->set_preference('SaveBiblioMarcModificationTemplate', 'TEST'); my $agent = Test::WWW::Mechanize->new(autocheck => 1); @@ -150,5 +150,5 @@ EOF # Clean up DelBiblio($biblionumber); DelModificationTemplate($template_id); - C4::Context->set_preference('EditBiblioMarcModificationTemplate', $old_template_preference); + C4::Context->set_preference('SaveBiblioMarcModificationTemplate', $old_template_preference); }; -- 2.20.1