Bugzilla – Attachment 110269 Details for
Bug 18138
Use MARC modification template when adding/updating bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18138: Rename system preference
Bug-18138-Rename-system-preference.patch (text/plain), 5.06 KB, created by
David Gustafsson
on 2020-09-17 14:38:29 UTC
(
hide
)
Description:
Bug 18138: Rename system preference
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2020-09-17 14:38:29 UTC
Size:
5.06 KB
patch
obsolete
>From a20e7039dc5f21be255de80c4e8d15d1f97bb006 Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >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 1955a4ba5f..2d72385401 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -848,7 +848,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 9be30eefec..b04f6ae74b 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 >@@ -150,7 +150,7 @@ Cataloging: > - "<br/>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 3a6013665a..b0be90516e 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 2e0772a563..0defb83065 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18138
:
61442
|
61443
|
61734
|
82783
|
86617
|
110266
|
110269
|
110270
|
110272
|
118439
|
118440
|
118441
|
118442
|
118443
|
118444
|
118824
|
120709
|
123125
|
123127
|
123128
|
123129
|
123130
|
123131
|
123132
|
123133
|
123137
|
124466
|
124467
|
124468
|
124469
|
124470
|
124471
|
124472
|
124473
|
124474
|
124475
|
124476
|
124477
|
124478
|
124484
|
124485
|
124486
|
124492
|
124493
|
124991
|
125157
|
148004
|
148005
|
148006
|
148007
|
148008
|
148009
|
157183
|
157184
|
157185
|
157186
|
157187
|
157188
|
157189
|
157190
|
157485
|
157486
|
157487
|
157488
|
157489
|
157490
|
157491
|
158414
|
158415
|
158416
|
158417
|
158418
|
158419
|
158420
|
158421
|
162612
|
162613