https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504

--- Comment #3 from Phil Ringnalda <[email protected]> ---
Created attachment 201774
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201774&action=edit
Bug 39504: Make MARC modification templates return not_exists fields for
actions

This patch makes a batch record modification check if a MARC modification
template can apply to all relevant tags.

This changes the Koha::SimpleMARC field_exists method to also return a list of
record fields where the tag/subfield doesn't exist. This patch only introduces
the usage of this list if the template has a 'not exists' condition, but this
list can now be implemented separately for other conditions too.

To test:

1. Go to Cataloging -> MARC modification templates
2. Create a new template and add an action "Update existing or add new field
700$e with value Editor if 700$e does not exist"
3. Edit a biblio i.e. biblionumber 418
4. Go to the 7 tab in the biblio editor and add the following data, then Save:
700 $a John Smith $e Editor
700 $a Sally Smith
5. Go to Cataloging -> Batch record modification
6. Add your biblionumber 418 and select your MARC modification template, then
continue
7. Click Show MARC next to the record
8. Notice that $e Editor has not been added to 700 $a Sally Smith, which the
MARC modification template action suggests would happen as $e does not exist
for that 700

9. Apply the patch and refresh the page

10. Repeat step 7, this time confirm that $e Editor has in fact been added to
700 $a Sally Smith
11. Confirm tests pass t/SimpleMARC.t

Sponsored-by: Māoriland Film Festival
Sponsored-by: Catalyst IT
Signed-off-by: Phil Ringnalda <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to