[Bug 39504] New: Batch record modification 'doesn't exist' condition not checking every matching tag
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Bug ID: 39504 Summary: Batch record modification 'doesn't exist' condition not checking every matching tag Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: aleisha@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org I feel like this MARC modification template isn't behaving as I expect it to. I have a biblio record with the following MARC: 700 $a John Smith $e Editor 700 $a Sally Smith I want a template that will add a value in 700$e if 700$e doesn't exist. My MARC modification template action looks like: - Add new field 700$e with value test if 700$e does not exist It doesn't work, probably because the earlier 700 tag does have the $e subfield, so the condition is false and it moves on. I've tried with other variations for the template action, for example - Add new field 700$e with value test2 if 700$e does not match RegEx m/(.*)/ Still doesn't apply, and I think it should be normal to expect that the MARC modification template will look at all 700 tags to apply this action. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |aleisha@catalyst.net.nz |ity.org | Change sponsored?|--- |Sponsored -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 --- Comment #1 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 180686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=180686&action=edit Bug 39504: [WIP] Make MARC modification templates return not_exists fields for actions Tests coming Sponsored-by: Māoriland Film Festival -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Comma delimited| |Catalyst IT, MÄoriland list of Sponsors| |Film Festival -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #180686|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Comma delimited|Catalyst IT, MÄoriland |Catalyst IT, Māoriland Film list of Sponsors|Film Festival |Festival -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 --- Comment #2 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 201511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201511&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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Phil Ringnalda <phil@chetcolibrary.org> 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=39504 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201511|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 --- Comment #3 from Phil Ringnalda <phil@chetcolibrary.org> --- 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 <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39504 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org