[Bug 17510] New: marc modification templates ignore subfield $0
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Bug ID: 17510 Summary: marc modification templates ignore subfield $0 Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Tools Assignee: gmcharlt@gmail.com Reporter: hagud@orex.es QA Contact: testopia@bugs.koha-community.org We have realized that Koha MArc modification templates ignore subfield 0, it is not very common used subfield, it is working with subfields greater than 0 We have create a template for adding 773$0 (host biblionumber in analytics) but the template doesn't get the subfield and only stores main tag 773. Checked in: Koha 3.22 & 16.05.05 Debian 8 and plack enabled TEST Go to Tools --> MARC modification templates Create one rule. Add/Update field 773 0 with value 'demo' save it you can check that subfield is not appearing in the descrption, if you edit it appears, but when you try to execute thah template, and try to previwe the marc you get internal error and get the following log. This action is not implemented yet at /usr/share/koha/lib/Koha/SimpleMARC.pm line 169. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@ccsr.qc | |.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |16.11 --- Comment #1 from Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca> --- Still valid in 16.11. Marjorie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Donna <bwsdonna@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bwsdonna@gmail.com --- Comment #2 from Donna <bwsdonna@gmail.com> --- This is still an issue in 17.11. Library is trying to remove subject headings using marc modification templates, specifically in the 650$0. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arouss1980@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Sarah Cornell <sbcornell@cityofportsmouth.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbcornell@cityofportsmouth. | |com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|16.11 |master CC| |katrin.fischer@bsz-bw.de Summary|marc modification templates |MARC modification templates |ignore subfield $0 |ignore subfield $0 --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Haven't confirmed in newer version yet. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #4 from Sarah Cornell <sbcornell@cityofportsmouth.com> --- Confirmed still an issue in 19.05. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Sarah Cornell from comment #4)
Confirmed still an issue in 19.05.
Thx, Sarah! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|gmcharlt@gmail.com |arouss1980@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #6 from Andreas Roussos <arouss1980@gmail.com> --- As Hugo pointed out, this bug has two aspects. 1) Firstly, there's the issue of the subfield not appearing in the MARC Modification Template (MMT) action description when its value is 0 (even though it will appear when editing the action). These are the relevant lines of code from marc_modification_templates.tt: 136 [% ActionsLoo.from_field | html %][% IF ( ActionsLoo.from_subfield ) %]$[% ActionsLoo.from_subfield | html %][% END %] 143 to [% ActionsLoo.to_field | html %][% IF ( ActionsLoo.to_subfield ) %]$[% ActionsLoo.to_subfield | html %][% END %] 154 [% ActionsLoo.conditional_field | html %][% IF ( ActionsLoo.conditional_subfield ) %]$[% ActionsLoo.conditional_subfield | html %][% END %] The problem lies with the "[% IF ( ... ) %]" statements: when the from/to/conditional subfield value is set to 0 the IF clause will evaluate to false and therefore the value will not be printed. 2) Secondly, we have an error message coming up in the Plack log file ("This action is not implemented yet"), and this relates to commit c7d862b (from Bug 11319). In that commit, among other things, the update_field() subroutine was added to SimpleMARC.pm, the most relevant lines of which are: 167 if ( not $subfieldName or $subfieldName eq '' ) { 168 # FIXME I'm not sure the actual implementation is correct. 169 die "This action is not implemented yet"; 170 #_update_field({ record => $record, field => $fieldName, values => \@values }); 171 } else { 172 _update_subfield({ record => $record, field => $fieldName, subfield => $subfieldName, values => \@values, field_numbers => $field_numbers }); 173 } The first condition in the 'if' clause above results in the expression evaluating to true when a subfield value of 0 (integer zero) or '0' (string zero) is entered -- hence the error message. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #7 from Andreas Roussos <arouss1980@gmail.com> --- Created attachment 99028 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99028&action=edit Bug 17510: enable use of subfield 0 in MMT actions When adding MARC modification template (MMT) actions, if a subfield value of 0 (zero) is entered it will not show up in the action's description upon saving. Also, if you try to modify an authority or biblio record using actions that refer to subfield 0 the procedure will fail. This patch fixes that. Test plan: 0) Create a MARC modification template and add some actions to it, ideally testing all action types (Delete/Add new/Update existing or add new/Move/Copy/Copy and replace); make sure you input a 0 (integer zero) in the text box for the subfield value(s). 1) As you save each action, observe that subfield 0 ($0) is missing from the action description. 2) Home > Tools > Batch record modification: try to modify a biblio- graphic record using the modification template you just created. Observe that you get an error in the system logs if you click on 'Show MARC' or 'Modify selected records'. 3) Apply the patch. 4) Repeat steps 0-2. The subfield value ($0) should be displayed in the action description and the Batch record modification should work without problems. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #8 from Andreas Roussos <arouss1980@gmail.com> --- Created attachment 99029 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99029&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t https://bugs.koha-community.org/show_bug.cgi?id=6473 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99029|0 |1 is obsolete| | --- Comment #9 from Andreas Roussos <arouss1980@gmail.com> --- Created attachment 99031 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99031&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #10 from Andreas Roussos <arouss1980@gmail.com> --- I've just realised that the URL for the git-bz test bug here on Bugzilla (Bug 6473) got included at the end of my previous commits. I tried to attach my patches to the test bug before attaching them here (just to be on the safe side), but must have messed up somewhere. I will re-attach them now... Sorry for any confusion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Andreas Roussos <arouss1980@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99028|0 |1 is obsolete| | Attachment #99031|0 |1 is obsolete| | --- Comment #11 from Andreas Roussos <arouss1980@gmail.com> --- Created attachment 99034 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99034&action=edit Bug 17510: enable use of subfield 0 in MMT actions When adding MARC modification template (MMT) actions, if a subfield value of 0 (zero) is entered it will not show up in the action's description upon saving. Also, if you try to modify an authority or biblio record using actions that refer to subfield 0 the procedure will fail. This patch fixes that. Test plan: 0) Create a MARC modification template and add some actions to it, ideally testing all action types (Delete/Add new/Update existing or add new/Move/Copy/Copy and replace); make sure you input a 0 (integer zero) in the text box for the subfield value(s). 1) As you save each action, observe that subfield 0 ($0) is missing from the action description. 2) Home > Tools > Batch record modification: try to modify a biblio- graphic record using the modification template you just created. Observe that you get an error in the system logs if you click on 'Show MARC' or 'Modify selected records'. 3) Apply the patch. 4) Repeat steps 0-2. The subfield value ($0) should be displayed in the action description and the Batch record modification should work without problems. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #12 from Andreas Roussos <arouss1980@gmail.com> --- Created attachment 99035 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99035&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99035|0 |1 is obsolete| | --- Comment #13 from Lisette Scheer <lisetteslatah@gmail.com> --- Created attachment 99050 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99050&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99050|0 |1 is obsolete| | --- Comment #14 from Lisette Scheer <lisetteslatah@gmail.com> --- Created attachment 99051 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99051&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Lisette Scheer <lisetteslatah@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99034|0 |1 is obsolete| | --- Comment #15 from Lisette Scheer <lisetteslatah@gmail.com> --- Created attachment 99052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99052&action=edit Bug 17510: enable use of subfield 0 in MMT actions When adding MARC modification template (MMT) actions, if a subfield value of 0 (zero) is entered it will not show up in the action's description upon saving. Also, if you try to modify an authority or biblio record using actions that refer to subfield 0 the procedure will fail. This patch fixes that. Test plan: 0) Create a MARC modification template and add some actions to it, ideally testing all action types (Delete/Add new/Update existing or add new/Move/Copy/Copy and replace); make sure you input a 0 (integer zero) in the text box for the subfield value(s). 1) As you save each action, observe that subfield 0 ($0) is missing from the action description. 2) Home > Tools > Batch record modification: try to modify a biblio- graphic record using the modification template you just created. Observe that you get an error in the system logs if you click on 'Show MARC' or 'Modify selected records'. 3) Apply the patch. 4) Repeat steps 0-2. The subfield value ($0) should be displayed in the action description and the Batch record modification should work without problems. Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99051|0 |1 is obsolete| | --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 99356 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99356&action=edit Bug 17510: update MMT-related unit tests The unit tests related to MARC modification templates need to be updated with extra tests specific to actions involving subfield 0. Test plan: 0) Apply the patch. 1) Run the updated unit tests, they should pass without any errors: $ prove t/SimpleMARC.t $ prove t/db_dependent/MarcModificationTemplates.t Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #99052|0 |1 is obsolete| | --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 99357 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=99357&action=edit Bug 17510: enable use of subfield 0 in MMT actions When adding MARC modification template (MMT) actions, if a subfield value of 0 (zero) is entered it will not show up in the action's description upon saving. Also, if you try to modify an authority or biblio record using actions that refer to subfield 0 the procedure will fail. This patch fixes that. Test plan: 0) Create a MARC modification template and add some actions to it, ideally testing all action types (Delete/Add new/Update existing or add new/Move/Copy/Copy and replace); make sure you input a 0 (integer zero) in the text box for the subfield value(s). 1) As you save each action, observe that subfield 0 ($0) is missing from the action description. 2) Home > Tools > Batch record modification: try to modify a biblio- graphic record using the modification template you just created. Observe that you get an error in the system logs if you click on 'Show MARC' or 'Modify selected records'. 3) Apply the patch. 4) Repeat steps 0-2. The subfield value ($0) should be displayed in the action description and the Batch record modification should work without problems. Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Signed Off |Passed QA --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Obvious fix, now well covered by tests.. Thanks Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 --- Comment #19 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Status|Pushed to master |Pushed to stable --- Comment #20 from Joy Nelson <joy@bywatersolutions.com> --- enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17510 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |26894 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26894 [Bug 26894] Marc Modification Templates treat subfield 0 as no subfield set when moving fields -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org