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.
Created attachment 61442 [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" prefernce to the name of the previously created template. 3) Edit (or create) a bibliographic record using either simple or advanced MARC editor. 4) Save the record. 5) Verify that the action(s) have been applied. Sponsored-by: Gothenburg University Library
Created attachment 61443 [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
Created attachment 61734 [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
Added some tests.
Created attachment 82783 [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
Rebase against master.
Created attachment 86617 [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: Frank Hansen <frank.hansen@ub.lu.se>
Signed off after testing that it works for me.
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.
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.
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
Created attachment 110269 [details] [review] Bug 18138: Rename system preference
Created attachment 110270 [details] [review] Bug 18138: Add system preference to sysprefs.sql
Created attachment 110272 [details] [review] Bug 18138: Fix tests
@Katrin Fischer Thank you for taking the time for review and feedback. The issues should now be addressed.
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.
Setting to "Failed QA" based on Comment 16.
*** Bug 24836 has been marked as a duplicate of this bug. ***
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
Created attachment 118440 [details] [review] Bug 18138: Rename system preference
Created attachment 118441 [details] [review] Bug 18138: Add system preference to sysprefs.sql
Created attachment 118442 [details] [review] Bug 18138: Fix tests
Created attachment 118443 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
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
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>
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
Created attachment 120709 [details] [review] Bug 18138: (QA follow-up) Fix QA script issues
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>
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
Created attachment 123128 [details] [review] Bug 18138: Rename system preference
Created attachment 123129 [details] [review] Bug 18138: Add system preference to sysprefs.sql
Created attachment 123130 [details] [review] Bug 18138: Fix tests
Created attachment 123131 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Created attachment 123132 [details] [review] Bug 18138: (QA follow-up) Fix QA script issues
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>
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>
Created attachment 124466 [details] [review] Bug 18138: Rename system preference
Created attachment 124467 [details] [review] Bug 18138: Add system preference to sysprefs.sql
Created attachment 124468 [details] [review] Bug 18138: Fix tests
Created attachment 124469 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Created attachment 124470 [details] [review] Bug 18138: (QA follow-up) Fix QA script issues
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>
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
Created attachment 124473 [details] [review] Bug 18138: Rename system preference
Created attachment 124474 [details] [review] Bug 18138: Add system preference to sysprefs.sql
Created attachment 124475 [details] [review] Bug 18138: Fix tests
Created attachment 124476 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Created attachment 124477 [details] [review] Bug 18138: (QA follow-up) Fix QA script issues
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>
Rebased against master.
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
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>
Created attachment 124486 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
Created attachment 124492 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
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>
Did some squashing to clean things up.
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.
Created attachment 124991 [details] [review] Bug 18138: Refactor after using template id instead of name
(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.
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?
Created attachment 125157 [details] [review] Bug 18138: fix atomic update and system preference type
(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.
Oof, and then nobody else looked at it for 18 months? Unsurprisingly, patches no longer apply.
(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.
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
Created attachment 148005 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
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>
Created attachment 148007 [details] [review] Bug 18138: Refactor after using template id instead of name
Created attachment 148008 [details] [review] Bug 18138: fix atomic update and system preference type
Created attachment 148009 [details] [review] Bug 18138: Fix variable name
Thanks for the feedback, have now rebased against master.
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.
(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.
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
Created attachment 157184 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates
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>
Created attachment 157186 [details] [review] Bug 18138: Refactor after using template id instead of name
Created attachment 157187 [details] [review] Bug 18138: fix atomic update and system preference type
Created attachment 157188 [details] [review] Bug 18138: Fix variable name
Created attachment 157189 [details] [review] Bug 18138: Fix tests, system preference specification and options
Created attachment 157190 [details] [review] Bug 18138: Fix tests, system preference specification and options
Rebased and fixed the issue where templates dropdown for syspref does not appear.
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>
Created attachment 157486 [details] [review] Bug 18138: (follow-up) Add Objects for MarcModificationTemplates Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
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>
Created attachment 157488 [details] [review] Bug 18138: Refactor after using template id instead of name Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 157489 [details] [review] Bug 18138: fix atomic update and system preference type Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 157490 [details] [review] Bug 18138: Fix variable name Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 157491 [details] [review] Bug 18138: Fix tests, system preference specification and options Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
Created attachment 162613 [details] [review] Bug 18138: Display error when template missing in advanced editor
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.