Bug 18138 - Use MARC modification template when adding/updating bibliographic records
Summary: Use MARC modification template when adding/updating bibliographic records
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: David Gustafsson
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
: 24836 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-02-17 13:09 UTC by Stefan Berndtsson
Modified: 2024-02-29 19:07 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 18138: Use MARC modification template when adding/updating bibliographic records (5.42 KB, patch)
2017-03-22 13:09 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (5.42 KB, patch)
2017-03-22 13:11 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (11.88 KB, patch)
2017-03-30 09:36 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (11.91 KB, patch)
2018-11-30 13:10 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (11.96 KB, patch)
2019-03-14 16:04 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (11.90 KB, patch)
2020-09-17 13:48 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Rename system preference (5.06 KB, patch)
2020-09-17 14:38 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Add system preference to sysprefs.sql (2.57 KB, patch)
2020-09-17 14:46 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests (1.73 KB, patch)
2020-09-17 15:35 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (11.95 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: Rename system preference (5.12 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: Add system preference to sysprefs.sql (2.63 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: Fix tests (1.72 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.25 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (2.39 KB, patch)
2021-03-17 20:32 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (2.44 KB, patch)
2021-03-25 15:41 UTC, Frank Hansen
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Fix QA script issues (1.05 KB, patch)
2021-05-07 17:54 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (2.55 KB, patch)
2021-07-23 14:40 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (12.04 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Rename system preference (5.08 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Add system preference to sysprefs.sql (2.61 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests (1.72 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.22 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Fix QA script issues (1.03 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (2.55 KB, patch)
2021-07-23 14:41 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (5.06 KB, patch)
2021-07-23 14:57 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Rename system preference (5.08 KB, patch)
2021-09-03 14:59 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Add system preference to sysprefs.sql (2.61 KB, patch)
2021-09-03 14:59 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests (1.72 KB, patch)
2021-09-03 14:59 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.22 KB, patch)
2021-09-03 14:59 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Fix QA script issues (1.03 KB, patch)
2021-09-03 15:00 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.81 KB, patch)
2021-09-03 15:00 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (12.09 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Rename system preference (5.08 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Add system preference to sysprefs.sql (2.61 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests (1.72 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.22 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Fix QA script issues (1.03 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.81 KB, patch)
2021-09-03 15:02 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (13.45 KB, patch)
2021-09-03 15:14 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.81 KB, patch)
2021-09-03 15:14 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.57 KB, patch)
2021-09-03 15:14 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.57 KB, patch)
2021-09-03 15:18 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.81 KB, patch)
2021-09-03 15:18 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Refactor after using template id instead of name (5.91 KB, patch)
2021-09-17 14:07 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: fix atomic update and system preference type (4.50 KB, patch)
2021-09-22 16:42 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (13.54 KB, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.58 KB, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.79 KB, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Refactor after using template id instead of name (5.89 KB, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: fix atomic update and system preference type (4.50 KB, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix variable name (738 bytes, patch)
2023-03-09 14:51 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (13.66 KB, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.58 KB, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.80 KB, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Refactor after using template id instead of name (5.91 KB, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: fix atomic update and system preference type (4.50 KB, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix variable name (738 bytes, patch)
2023-10-16 13:03 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests, system preference specification and options (5.11 KB, patch)
2023-10-16 13:04 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Fix tests, system preference specification and options (4.81 KB, patch)
2023-10-16 13:08 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (13.70 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.63 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.85 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: Refactor after using template id instead of name (5.96 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: fix atomic update and system preference type (4.54 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: Fix variable name (791 bytes, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: Fix tests, system preference specification and options (4.85 KB, patch)
2023-10-20 04:30 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 18138: Use MARC modification template when adding/updating bibliographic records (13.75 KB, patch)
2023-11-05 00:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates (5.68 KB, patch)
2023-11-05 00:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template (6.90 KB, patch)
2023-11-05 00:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: Refactor after using template id instead of name (6.01 KB, patch)
2023-11-05 00:30 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: fix atomic update and system preference type (4.60 KB, patch)
2023-11-05 00:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: Fix variable name (848 bytes, patch)
2023-11-05 00:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: Fix tests, system preference specification and options (4.91 KB, patch)
2023-11-05 00:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Perltidy and 'staff client' (16.93 KB, patch)
2023-11-05 00:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 18138: (QA follow-up) Perltidy and 'staff client' (16.92 KB, patch)
2024-02-29 18:13 UTC, David Gustafsson
Details | Diff | Splinter Review
Bug 18138: Display error when template missing in advanced editor (4.37 KB, patch)
2024-02-29 18:13 UTC, David Gustafsson
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Berndtsson 2017-02-17 13:09:41 UTC
When importing records, MARC modification templates can be used to silently remove unwanted tags among other thing. The same thing could be useful when adding/updating bibliographic records from within Koha.

I therefor propose an addition of a SysPref to set a default template to use in AddBiblio and ModBiblio before TransformMarcToKoha is called.
Comment 1 David Gustafsson 2017-03-22 13:09:49 UTC Comment hidden (obsolete)
Comment 2 David Gustafsson 2017-03-22 13:11:53 UTC Comment hidden (obsolete)
Comment 3 David Gustafsson 2017-03-30 09:36:04 UTC Comment hidden (obsolete)
Comment 4 David Gustafsson 2017-03-30 09:36:44 UTC
Added some tests.
Comment 5 David Gustafsson 2018-11-30 13:10:30 UTC Comment hidden (obsolete)
Comment 6 David Gustafsson 2018-11-30 13:11:04 UTC
Rebase against master.
Comment 7 ByWater Sandboxes 2019-03-14 16:04:07 UTC Comment hidden (obsolete)
Comment 8 Frank Hansen 2019-03-15 13:56:20 UTC
Signed off after testing that it works for me.
Comment 9 Katrin Fischer 2019-05-11 13:50:15 UTC
Sorry, but there are some issues:

1) The new preference needs to be added to sysprefs.sql

2) The QA script fails (easy fix):

 FAIL	t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t
   OK	  critic
   FAIL	  forbidden patterns
		forbidden pattern: tab char (line 47)
		forbidden pattern: tab char (line 49)
		forbidden pattern: tab char (line 75)
		forbidden pattern: tab char (line 76)
		forbidden pattern: tab char (line 77)
		forbidden pattern: tab char (line 78)
		forbidden pattern: tab char (line 79)
		forbidden pattern: tab char (line 81)
		forbidden pattern: tab char (line 82)

3) The tests fail:

# Subtest: Templates applied using simple and advanced MARC Editor
    1..13
    ok 1 - MARC modification template successfully created
    ok 2 - MARC modification template action successfully created
    # Looks like you planned 13 tests but ran 2.
not ok 1 - Templates applied using simple and advanced MARC Editor

#   Failed test 'Templates applied using simple and advanced MARC Editor'
#   at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 154.
Can't use string ("444") as a HASH ref while "strict refs" in use at /home/vagrant/kohaclone/C4/Biblio.pm line 1162.
# Looks like your test exited with 255 just after 1.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests 

4) I think maybe we should remove "Edit" from the preference name if it also applies on saving. Maybe: UseMarcModificationTemplate or DefaultMarcModificationTemplate? Native speakers might have other ideas.
Comment 10 Katrin Fischer 2019-05-11 13:51:10 UTC
For future use it might be nice to have a setting on framework level too and some note on saving that that modifications have been made.
Comment 11 David Gustafsson 2020-09-17 13:48:13 UTC
Created attachment 110266 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 12 David Gustafsson 2020-09-17 14:38:29 UTC
Created attachment 110269 [details] [review]
Bug 18138: Rename system preference
Comment 13 David Gustafsson 2020-09-17 14:46:07 UTC
Created attachment 110270 [details] [review]
Bug 18138: Add system preference to sysprefs.sql
Comment 14 David Gustafsson 2020-09-17 15:35:25 UTC
Created attachment 110272 [details] [review]
Bug 18138: Fix tests
Comment 15 David Gustafsson 2020-09-18 13:56:53 UTC
@Katrin Fischer Thank you for taking the time for review and feedback. The issues should now be addressed.
Comment 16 Fridolin Somers 2020-09-25 09:07:22 UTC
Hi, nice work.

I see :
my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();

Looks odd to me.
Indeed marc modification template name is not unique.
I think this can be buggy.

I suggest add unique constraint to marc modification template name
or store marc modification template id for this feature.
Comment 17 Owen Leonard 2021-02-25 16:15:22 UTC
Setting to "Failed QA" based on Comment 16.
Comment 18 Nick Clemens (kidclamp) 2021-03-17 19:43:55 UTC
*** Bug 24836 has been marked as a duplicate of this bug. ***
Comment 19 Nick Clemens (kidclamp) 2021-03-17 20:32:13 UTC
Created attachment 118439 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 20 Nick Clemens (kidclamp) 2021-03-17 20:32:17 UTC
Created attachment 118440 [details] [review]
Bug 18138: Rename system preference
Comment 21 Nick Clemens (kidclamp) 2021-03-17 20:32:20 UTC
Created attachment 118441 [details] [review]
Bug 18138: Add system preference to sysprefs.sql
Comment 22 Nick Clemens (kidclamp) 2021-03-17 20:32:23 UTC
Created attachment 118442 [details] [review]
Bug 18138: Fix tests
Comment 23 Nick Clemens (kidclamp) 2021-03-17 20:32:26 UTC
Created attachment 118443 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 24 Nick Clemens (kidclamp) 2021-03-17 20:32:29 UTC
Created attachment 118444 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id
Comment 25 Frank Hansen 2021-03-25 15:41:17 UTC
Created attachment 118824 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 26 Kyle M Hall (khall) 2021-05-07 17:51:28 UTC
prove t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t
t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t .. Warning: <retrieval> element has non-unique value in 'name' key attribute: F at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 36.
Warning: <retrieval> element has non-unique value in 'name' key attribute: B at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 36.
GetMarcBiblio called with undefined biblionumber at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 85.
    # Looks like you planned 13 tests but ran 2.
t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t .. 1/1
#   Failed test 'Templates applied using simple and advanced MARC Editor'
#   at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 154.
Can't call method "field" on an undefined value at t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t line 86.
# Looks like your test exited with 255 just after 1.
t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/1 subtests

Test Summary Report
-------------------
t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t (Wstat: 65280 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 255
Files=1, Tests=1,  4 wallclock secs ( 0.02 usr  0.00 sys +  1.79 cusr  0.27 csys =  2.08 CPU)
Result: FAIL
Comment 27 Kyle M Hall (khall) 2021-05-07 17:54:15 UTC
Created attachment 120709 [details] [review]
Bug 18138: (QA follow-up) Fix QA script issues
Comment 28 David Gustafsson 2021-07-23 14:40:00 UTC
Created attachment 123125 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 29 David Gustafsson 2021-07-23 14:41:09 UTC
Created attachment 123127 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 30 David Gustafsson 2021-07-23 14:41:14 UTC
Created attachment 123128 [details] [review]
Bug 18138: Rename system preference
Comment 31 David Gustafsson 2021-07-23 14:41:20 UTC
Created attachment 123129 [details] [review]
Bug 18138: Add system preference to sysprefs.sql
Comment 32 David Gustafsson 2021-07-23 14:41:24 UTC
Created attachment 123130 [details] [review]
Bug 18138: Fix tests
Comment 33 David Gustafsson 2021-07-23 14:41:29 UTC
Created attachment 123131 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 34 David Gustafsson 2021-07-23 14:41:33 UTC
Created attachment 123132 [details] [review]
Bug 18138: (QA follow-up) Fix QA script issues
Comment 35 David Gustafsson 2021-07-23 14:41:39 UTC
Created attachment 123133 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 36 David Gustafsson 2021-07-23 14:57:47 UTC
Created attachment 123137 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 37 David Gustafsson 2021-09-03 14:59:44 UTC
Created attachment 124466 [details] [review]
Bug 18138: Rename system preference
Comment 38 David Gustafsson 2021-09-03 14:59:48 UTC
Created attachment 124467 [details] [review]
Bug 18138: Add system preference to sysprefs.sql
Comment 39 David Gustafsson 2021-09-03 14:59:53 UTC
Created attachment 124468 [details] [review]
Bug 18138: Fix tests
Comment 40 David Gustafsson 2021-09-03 14:59:57 UTC
Created attachment 124469 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 41 David Gustafsson 2021-09-03 15:00:02 UTC
Created attachment 124470 [details] [review]
Bug 18138: (QA follow-up) Fix QA script issues
Comment 42 David Gustafsson 2021-09-03 15:00:07 UTC
Created attachment 124471 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 43 David Gustafsson 2021-09-03 15:02:24 UTC
Created attachment 124472 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 44 David Gustafsson 2021-09-03 15:02:29 UTC
Created attachment 124473 [details] [review]
Bug 18138: Rename system preference
Comment 45 David Gustafsson 2021-09-03 15:02:34 UTC
Created attachment 124474 [details] [review]
Bug 18138: Add system preference to sysprefs.sql
Comment 46 David Gustafsson 2021-09-03 15:02:38 UTC
Created attachment 124475 [details] [review]
Bug 18138: Fix tests
Comment 47 David Gustafsson 2021-09-03 15:02:43 UTC
Created attachment 124476 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 48 David Gustafsson 2021-09-03 15:02:47 UTC
Created attachment 124477 [details] [review]
Bug 18138: (QA follow-up) Fix QA script issues
Comment 49 David Gustafsson 2021-09-03 15:02:52 UTC
Created attachment 124478 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 50 David Gustafsson 2021-09-03 15:05:08 UTC
Rebased against master.
Comment 51 David Gustafsson 2021-09-03 15:14:25 UTC
Created attachment 124484 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 52 David Gustafsson 2021-09-03 15:14:30 UTC
Created attachment 124485 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 53 David Gustafsson 2021-09-03 15:14:35 UTC
Created attachment 124486 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 54 David Gustafsson 2021-09-03 15:18:17 UTC
Created attachment 124492 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 55 David Gustafsson 2021-09-03 15:18:22 UTC
Created attachment 124493 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 56 David Gustafsson 2021-09-03 15:21:54 UTC
Did some squashing to clean things up.
Comment 57 Phil Ringnalda 2021-09-15 23:03:26 UTC
Fails for me in koha-testing-docker startup, with

koha_1       | C4::Installer::load_sql returned the following errors while attempting to load /kohadevbox/koha/installer/data/mysql/mandatory/sysprefs.sql:
koha_1       | DBD::mysql::st execute failed: Data too long for column 'type' at row 588 at /usr/share/perl5/DBIx/RunSQL.pm line 278, <$args{...}> line 1.
koha_1       | Something went wrong loading file /kohadevbox/koha/installer/data/mysql/mandatory/sysprefs.sql ([SQL ERROR]: INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES

Looks like at 22 characters, modification-templates doesn't quite fit in a 20 character column.
Comment 58 David Gustafsson 2021-09-17 14:07:33 UTC
Created attachment 124991 [details] [review]
Bug 18138: Refactor after using template id instead of name
Comment 59 David Gustafsson 2021-09-17 14:12:39 UTC
(In reply to Phil Ringnalda from comment #57)
> Fails for me in koha-testing-docker startup, with
> 
> koha_1       | C4::Installer::load_sql returned the following errors while
> attempting to load
> /kohadevbox/koha/installer/data/mysql/mandatory/sysprefs.sql:
> koha_1       | DBD::mysql::st execute failed: Data too long for column
> 'type' at row 588 at /usr/share/perl5/DBIx/RunSQL.pm line 278, <$args{...}>
> line 1.
> koha_1       | Something went wrong loading file
> /kohadevbox/koha/installer/data/mysql/mandatory/sysprefs.sql ([SQL ERROR]:
> INSERT INTO systempreferences ( `variable`, `value`, `options`,
> `explanation`, `type` ) VALUES
> 
> Looks like at 22 characters, modification-templates doesn't quite fit in a
> 20 character column.

That column has length 50 for me, and also in kohastructure.sql. Don't know if you created this table using a different version of Koha. If this can be reproduced will address the issue.

Some things in the patch needed adjustment after changing to using template ids instead of name. There is a problem with Elasticsearch in my devbox for recent version of Koha which had not had time to fix, so was not able to properly test the code. Meanwhile submitting and hoping for the best, will get back to properly testing this once this issue has been sorted out.
Comment 61 David Gustafsson 2021-09-22 16:42:32 UTC
Created attachment 125157 [details] [review]
Bug 18138: fix atomic update and system preference type
Comment 62 David Gustafsson 2021-09-22 16:46:23 UTC
(In reply to Phil Ringnalda from comment #60)
> https://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=installer/data/
> mysql/kohastructure.sql;h=02cf864ddd7f0f2ca6a921ae2a9045a18e1375f6;
> hb=HEAD#l4987 - type is 20, no?

Hi! Yes, sorry. I misunderstood. The reason it seamed to work for me and I did not get the crash was (probably) the patch using an old koha format for patch database updates (atomicupdate). My guess is you tried the patch out with a slightly older version of Koha where the old format worked and got the error, and for me it simply did not run (nor produce any errors) and the syspref had been previously added before the type change. I fixed the atomicupdate to use perl-script instead, and shortened the type name.
Comment 63 Phil Ringnalda 2023-03-04 04:20:45 UTC
Oof, and then nobody else looked at it for 18 months?

Unsurprisingly, patches no longer apply.
Comment 64 Katrin Fischer 2023-03-04 12:15:06 UTC
(In reply to Phil Ringnalda from comment #63)
> Oof, and then nobody else looked at it for 18 months?
> 
> Unsurprisingly, patches no longer apply.

We are in need for more testers, always.
Comment 65 David Gustafsson 2023-03-09 14:51:19 UTC
Created attachment 148004 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 66 David Gustafsson 2023-03-09 14:51:23 UTC
Created attachment 148005 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 67 David Gustafsson 2023-03-09 14:51:26 UTC
Created attachment 148006 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 68 David Gustafsson 2023-03-09 14:51:29 UTC
Created attachment 148007 [details] [review]
Bug 18138: Refactor after using template id instead of name
Comment 69 David Gustafsson 2023-03-09 14:51:33 UTC
Created attachment 148008 [details] [review]
Bug 18138: fix atomic update and system preference type
Comment 70 David Gustafsson 2023-03-09 14:51:36 UTC
Created attachment 148009 [details] [review]
Bug 18138: Fix variable name
Comment 71 David Gustafsson 2023-03-09 14:52:41 UTC
Thanks for the feedback, have now rebased against master.
Comment 72 Phil Ringnalda 2023-03-16 01:43:18 UTC
Something's gone wrong with the bit to select a template from a list of template names for the pref: I get no list, though if I enter the id of a template, it seems to be applied just fine.
Comment 73 Katrin Fischer 2023-06-10 20:24:03 UTC
(In reply to Phil Ringnalda from comment #72)
> Something's gone wrong with the bit to select a template from a list of
> template names for the pref: I get no list, though if I enter the id of a
> template, it seems to be applied just fine.

I believe this should have been set to Failed QA.
Comment 74 David Gustafsson 2023-10-16 13:03:41 UTC
Created attachment 157183 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Comment 75 David Gustafsson 2023-10-16 13:03:45 UTC
Created attachment 157184 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Comment 76 David Gustafsson 2023-10-16 13:03:48 UTC
Created attachment 157185 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Comment 77 David Gustafsson 2023-10-16 13:03:51 UTC
Created attachment 157186 [details] [review]
Bug 18138: Refactor after using template id instead of name
Comment 78 David Gustafsson 2023-10-16 13:03:55 UTC
Created attachment 157187 [details] [review]
Bug 18138: fix atomic update and system preference type
Comment 79 David Gustafsson 2023-10-16 13:03:58 UTC
Created attachment 157188 [details] [review]
Bug 18138: Fix variable name
Comment 80 David Gustafsson 2023-10-16 13:04:02 UTC
Created attachment 157189 [details] [review]
Bug 18138: Fix tests, system preference specification and options
Comment 81 David Gustafsson 2023-10-16 13:08:13 UTC
Created attachment 157190 [details] [review]
Bug 18138: Fix tests, system preference specification and options
Comment 82 David Gustafsson 2023-10-16 13:11:33 UTC
Rebased and fixed the issue where templates dropdown for syspref does not appear.
Comment 83 Phil Ringnalda 2023-10-20 04:30:15 UTC
Created attachment 157485 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 84 Phil Ringnalda 2023-10-20 04:30:21 UTC
Created attachment 157486 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 85 Phil Ringnalda 2023-10-20 04:30:28 UTC
Created attachment 157487 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 86 Phil Ringnalda 2023-10-20 04:30:35 UTC
Created attachment 157488 [details] [review]
Bug 18138: Refactor after using template id instead of name

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 87 Phil Ringnalda 2023-10-20 04:30:40 UTC
Created attachment 157489 [details] [review]
Bug 18138: fix atomic update and system preference type

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 88 Phil Ringnalda 2023-10-20 04:30:46 UTC
Created attachment 157490 [details] [review]
Bug 18138: Fix variable name

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 89 Phil Ringnalda 2023-10-20 04:30:52 UTC
Created attachment 157491 [details] [review]
Bug 18138: Fix tests, system preference specification and options

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Comment 90 Katrin Fischer 2023-11-05 00:30:46 UTC
Created attachment 158414 [details] [review]
Bug 18138: Use MARC modification template when adding/updating bibliographic records

Add a preference that enables a specific marc modification template to be applied on bibliographic records saved using simple or advanced MARC editor or the HTTP API.

To test:
1) Create a MARC modification template containg one or more actions.
2) Under "Global system preferences" and "Cataloging" set the "EditBiblioMarcModificationTemplate" preference to the name of the previously created template.
3) Edit (or create) a bibliographic record using either the simple or advanced MARC editor.
4) Save the record.
5) Verify that the action(s) have been applied.

Sponsored-by: Gothenburg University Library
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 91 Katrin Fischer 2023-11-05 00:30:50 UTC
Created attachment 158415 [details] [review]
Bug 18138: (follow-up) Add Objects for MarcModificationTemplates

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 92 Katrin Fischer 2023-11-05 00:30:54 UTC
Created attachment 158416 [details] [review]
Bug 18138: (follow-up) Adjust the system preference editor to allow choosing a modification template

Rather than expecting the librarian to add an ID or a name we should provide a dropdown

To test:
1 - Apply all patches
2 - Search for sytem preference 'SaveBiblioMarcModificationTemplate'
3 - Note it list all defined Marc modification templates
4 - Select one
5 - confirm value in DB is the template id

Works fine for me

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 93 Katrin Fischer 2023-11-05 00:30:58 UTC
Created attachment 158417 [details] [review]
Bug 18138: Refactor after using template id instead of name

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 94 Katrin Fischer 2023-11-05 00:31:02 UTC
Created attachment 158418 [details] [review]
Bug 18138: fix atomic update and system preference type

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 95 Katrin Fischer 2023-11-05 00:31:06 UTC
Created attachment 158419 [details] [review]
Bug 18138: Fix variable name

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 96 Katrin Fischer 2023-11-05 00:31:10 UTC
Created attachment 158420 [details] [review]
Bug 18138: Fix tests, system preference specification and options

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 97 Katrin Fischer 2023-11-05 00:31:15 UTC
Created attachment 158421 [details] [review]
Bug 18138: (QA follow-up) Perltidy and 'staff client'

* Perltidies files
* Fix atomic update (description and success message)
* Fix atomic update file permissions
* Update 'staff client' to 'staff interface'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 98 Katrin Fischer 2023-11-05 00:36:24 UTC
1) This one feels a little strange as it includes the advanced MARC editor and the old svc/HTTP API, but not the rest API.

I can't test that API so I don't feel comfortable to pass QA here and would like to hand over to someone who can.


2) Are they really both needed?

+use C4::MarcModificationTemplates;
+use Koha::MarcModificationTemplates;


3) QA test tools

I got them mostly to pass with my follow-ups, but _please_ don't rely on the QA team for those fixes, usually there is no time for such things.

This seems a false positive, the file is new and I perltidied it, but this remains:

 WARN	t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t
   WARN	  tidiness
		The file is less tidy than before (bad/messy lines before: 0, now: 1)

4) Deleting the template breaks editors

* Advanced editor no longer let's you save a record with an unspecific error message
Logs: Carp::croak('No MARC modification template exists with id "13"') called at /kohadevbox/koha/svc/bib line 137
* Normal editor explodes into an error:
No MARC modification template exists with id "13" at /usr/share/perl5/CGI/Compile.pm line 151.
 at /usr/lib/x86_64-linux-gnu/perl-base/Carp.pm line 289

I feel we need to handle this more gracefully.
Comment 99 David Gustafsson 2024-02-29 18:13:51 UTC
Created attachment 162612 [details] [review]
Bug 18138: (QA follow-up) Perltidy and 'staff client'

* Perltidies files
* Fix atomic update (description and success message)
* Fix atomic update file permissions
* Update 'staff client' to 'staff interface'

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 100 David Gustafsson 2024-02-29 18:13:54 UTC
Created attachment 162613 [details] [review]
Bug 18138: Display error when template missing in advanced editor
Comment 101 David Gustafsson 2024-02-29 19:07:52 UTC
Fixed 4), regarding 2), yes both are needed. Now when I had a look at this also discovered that modification templates are not applied when saving new biblio using the advanced editor. Easy to fix, but I am also beginning to reconsider whether this whole feature is a good idea to begin with. Also kind of wonder why did not decided to apply the template withing ModBibioMarc as that would simplify the code. The downside I guess is that templates would even be applied, even in cases where biblios are saved internally where it does perhaps do not make sense to do so. Also the error handling and user feedback would be harder to implement since AddBibio/ModBibio would either have to throw an error or return some error code and such a major change in behavior could have unforeseen consequences if not handles correctly in the entire code base.