https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21860 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA CC| |pedro.amorim@openfifth.co.u | |k --- Comment #84 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Hi all, 3 findings here worth addressing: Finding 1: 'Add new' ignores the indicators you type 1) Apply the patches, updatedatabase and restart_all 2) Go to Cataloging > MARC modification templates: http://localhost:8081/cgi-bin/koha/tools/marc_modification_templates.pl 3) Create a new template, name it 'Bug 21860 add' 4) Action: 'Add new', field 650, subfield a, with value 'Dogs' 5) Check 'Use indicators'. Enter indicator 1 = '1' and indicator 2 = '7' in the inputs that appear. Click 'Add action' 6) Preview the template on biblio 1 (this assumes the template id is 1, check the template_id in the URL): http://localhost:8081/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=1&mmtid=1&overlay_context=batchmod 7) Look at the new 650 $a Dogs => Expected: 650 17 $a Dogs (the indicators you entered) => Actual: 650 __ $a Dogs (the indicators are ignored, left blank) Finding 2: 'Update existing or add new' with 'Use indicators' splits the field This follows on from the fix for comments 66 (point 3) and 73. Comment 74 says the 'add new' behavior is preserved when the target field/subfield does not exist. That's right when the field doesn't exist, but when the field exists and only the subfield is missing, it now creates a new field instead of adding the subfield to the existing one. 1) In the same tool, create a new template, name it 'Bug 21860 update' 2) Action: 'Update existing or add new', field 650, subfield x, with value 'Moral aspects'. Click 'Add action' 3) Preview it on biblio 1 (650 _0 $a Rock musicians (...)), this assumes the template id is 2: http://localhost:8081/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=1&mmtid=2&overlay_context=batchmod 4) Confirm you get one field: 650 _0 $a Rock musicians (...) $x Moral aspects 5) Edit the action, check 'Use indicators', enter indicator 2 = '0', save it 6) Repeat 3) => Expected: the same single field as 4), 650 _0 $a Rock musicians (...) $x Moral aspects ('Use indicators' should only set the indicators) => Actual: two fields, 650 _0 $a Rock musicians (...) and a separate 650 _0 $x Moral aspects (the heading is split in two) Finding 3: copying a repeated subfield picks the value from the wrong field 1) Edit biblio 1 in the basic editor: http://localhost:8081/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=1 2) In the existing 650 _0 $a Rock musicians (...), add $x History and a second $x Criticism 3) Add a new 650 with indicator 2 = 7: $a Dogs $x Training $2 fast. Save the record 4) Confirm biblio 1 now has these two 650s: 650 _0 $a Rock musicians (...) $x History $x Criticism 650 _7 $a Dogs $x Training $2 fast 5) Create a new template, name it 'Bug 21860 copy' 6) Action: 'Copy', field(s) 'All', field 650 subfield x, to field 651 subfield x 7) Check 'Use indicators', enter source indicator 2 = '7'. Click 'Add action' 8) Preview it on biblio 1, this assumes the template id is 3: http://localhost:8081/cgi-bin/koha/svc/records/preview?record_type=biblio&record_id=1&mmtid=3&overlay_context=batchmod => Expected: 651 $x Training (from the 650 with indicator 2 = 7, the only field matching the indicators) => Actual: 651 $x Criticism (only the 650 with indicator 2 = 0 has this value) Minor notes: - AddModificationTemplateAction and ModModificationTemplateAction now take the new arguments in the middle of the list. All callers in Koha are updated, but any plugin or local script using the old order would silently save values into the wrong columns. Adding them at the end, or switching to a hashref, would avoid that. - The ModModificationTemplateAction POD lists $from_field twice (C4/MarcModificationTemplates.pm line 344). -- You are receiving this mail because: You are watching all bug changes.