https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21860
--- Comment #45 from Andrew Fuerste-Henry <[email protected]> --- Created attachment 203566 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203566&action=edit Bug 21860: Apply MARC indicators in modification templates Test plan 1. Apply the database update for this bug if it has not already been applied. 2. Run the automated tests: prove t/SimpleMARC.t prove t/db_dependent/MarcModificationTemplates.t Both tests should pass. Also run: perl -c C4/MarcModificationTemplates.pm perl -c Koha/SimpleMARC.pm node --check koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js git diff --check The Perl files should report "syntax OK". The JavaScript syntax check and git diff --check should return no errors. MARC modification template UI ----------------------------- 3. Go to: Tools > MARC modification templates 4. Create a new template named: Bug 21860 indicator test 5. Test whole-field copy with source and destination indicators. Add a new action with: Action: Copy Field number: All Source field: 650 Source subfield: blank Check "Use indicators" Source indicator 1: 1 Source indicator 2: 7 Destination field: 651 Destination subfield: blank Destination indicator 1: one blank space Destination indicator 2: 0 Condition: blank Description: Copy 650 ind 1/7 to 651 ind blank/0 6. Save the action. 7. Confirm that the action summary displays the source and destination indicators, for example: Copy field 650 (ind1: 1, ind2: 7) to 651 (ind1: , ind2: 0) 8. Click Edit on the action. 9. Confirm that all saved values are restored: - Use indicators is checked - Source field is 650 - Source indicator 1 is 1 - Source indicator 2 is 7 - Destination field is 651 - Destination indicator 1 is blank - Destination indicator 2 is 0 10. Change destination indicator 2 to another value, save the action, then edit it again. Confirm that the updated indicator value is retained. Conditional indicators ---------------------- 11. Test conditional indicators. Add or edit an action with: Action: Copy Source field: 650 Source indicators: 1 / 7 Destination field: 651 Destination indicators: blank / 0 Condition: if Conditional field: 650 Conditional subfield: blank Conditional indicator 1: 1 Conditional indicator 2: 7 Comparison: exists 12. Save the action. 13. Confirm that the action summary displays the conditional indicators, for example: Copy field 650 (ind1: 1, ind2: 7) to 651 (ind1: , ind2: 0) if 650 (ind1: 1, ind2: 7) exists 14. Edit the action again and confirm that the conditional indicator values are restored. Form reset behavior ------------------- 15. Test form reset behavior. - Edit an existing action containing indicator values. - Click Cancel. - Click New action. - Confirm that "Use indicators" is unchecked. - Check "Use indicators". - Confirm that the source, destination, and conditional indicator fields do not contain values from the previously edited action. Control fields -------------- 16. Test control fields as the source. Create a Copy action and enter 008 as the source field. Check "Use indicators". Confirm that: - the source indicator inputs are not displayed - indicator controls are not offered for the 008 field 17. Enter 650 as the destination field. Confirm that: - destination indicator 1 and indicator 2 inputs are displayed - source indicator inputs remain hidden for 008 18. Test the reverse direction. Source field: 650 Destination field: 008 Use indicators: checked Confirm that: - source indicator inputs are displayed for 650 - destination indicator inputs are not displayed for 008 19. Test a control field as the conditional field. Select a condition such as "if" and enter 008 as the conditional field. Confirm that conditional indicator inputs are not displayed. 20. Change the conditional field to 650. Confirm that conditional indicator 1 and indicator 2 inputs become available. Functional testing against a bibliographic record ------------------------------------------------- 21. Create or edit a test bibliographic record so that it contains at least these two fields: 650 17 $a Dogs 650 _0 $a Cats In the examples above, "_" represents a literal blank MARC indicator. The two fields deliberately use different indicators so that indicator matching can be verified. Source indicator filtering -------------------------- 22. Create a new MARC modification template/action: Action: Copy Field number: All Source field: 650 Source subfield: blank Use indicators: checked Source indicator 1: 1 Source indicator 2: 7 Destination field: 651 Destination subfield: blank Destination indicator 1: leave unset Destination indicator 2: leave unset 23. Apply the template to the test bibliographic record using: Tools > Batch record modification 24. Open the modified bibliographic record. Expected result: 650 17 $a Dogs 650 _0 $a Cats 651 17 $a Dogs There should NOT be a new: 651 _0 $a Cats This confirms that source indicator criteria select only fields whose indicators match 1/7. Explicit blank source indicator ------------------------------- 25. Create another action using: Action: Copy Field number: All Source field: 650 Source subfield: blank Use indicators: checked Source indicator 1: one literal blank space Source indicator 2: 0 Destination field: 651 Destination subfield: blank Destination indicator 1: leave unset Destination indicator 2: leave unset 26. Apply the template to the test record. Expected result: 651 _0 $a Cats The following should NOT be copied by this action: 650 17 $a Dogs This confirms that a literal blank MARC indicator can be explicitly matched and is distinct from leaving an indicator criterion unset. Partial source indicator matching --------------------------------- 27. Create another action: Action: Copy Field number: All Source field: 650 Source subfield: blank Use indicators: checked Source indicator 1: 1 Source indicator 2: leave unset Destination field: 651 Destination subfield: blank Destination indicator 1: leave unset Destination indicator 2: leave unset 28. Apply the template. Expected result: 651 17 $a Dogs The following should NOT be copied: 650 _0 $a Cats This confirms that an unset source indicator does not require a blank indicator. Instead, no restriction is applied for that indicator position. Explicit destination indicators ------------------------------- 29. Create another action: Action: Copy Field number: All Source field: 650 Source subfield: blank Use indicators: checked Source indicator 1: 1 Source indicator 2: 7 Destination field: 651 Destination subfield: blank Destination indicator 1: one literal blank space Destination indicator 2: 0 30. Apply the template. Expected destination field: 651 _0 $a Dogs Confirm in the MARC editor that: - indicator 1 is blank - indicator 2 is 0 - $a contains Dogs This confirms that explicitly supplied destination indicators replace the source indicators on the newly created destination field. Unset destination indicators ---------------------------- 31. Repeat the copy from: 650 17 $a Dogs to field 651, but leave both destination indicators completely unset. Expected destination: 651 17 $a Dogs This confirms that when destination indicators are not supplied, the source field's indicators are preserved. Regression testing ------------------ 32. Create a MARC modification template action without selecting "Use indicators". Configure a normal existing MARC modification operation. 33. Save, edit, and apply the action. Confirm that the action behaves as it did before this enhancement and that indicator criteria are not required. 34. Confirm that existing MARC modification template actions created before this enhancement can still be viewed, edited, and applied without adding indicator criteria. Additional functional coverage ------------------------------ 35. Test Move with indicators against a bibliographic record. Verify that: - only the source field matching the specified indicators is moved - the source field is removed - the destination field is created - explicitly supplied destination indicators are applied - unrelated fields are unchanged 36. Test Copy and replace with indicators against a bibliographic record. Verify that: - only fields matching the source indicator criteria participate in the operation - the destination receives the expected value - explicitly supplied destination indicators are applied - unrelated fields are unchanged 37. Test a conditional indicator criterion against an actual bibliographic record. Use a record containing fields with different indicators. Confirm that the action runs when the conditional field has the requested indicators. 38. Repeat the conditional test using indicators that do not match the record. Confirm that the action does not run. 39. Confirm the resulting MARC record after each functional test and verify that no unrelated fields or indicators have been modified. 40. Sign off and have a wonderful day! :D Sponsored-by: koha-US <https://koha-us.org/> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
