[Bug 19069] New: "Doesn't match" option fails in MARC Modification Templates
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Bug ID: 19069 Summary: "Doesn't match" option fails in MARC Modification Templates Change sponsored?: --- Product: Koha Version: 17.05 Hardware: Macintosh OS: Mac OS Status: NEW Severity: normal Priority: P5 - low Component: MARC Bibliographic record staging/import Assignee: koha-bugs@lists.koha-community.org Reporter: jfowler@sebts.edu QA Contact: testopia@bugs.koha-community.org Created attachment 65781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=65781&action=edit A single MARC record to use in order to test what I'm describing. When adding a new action in a MARCH modification template, the "doesn't match" option fails in places where there are multiple fields. I was importing MARC records with item holdings in 999 fields. Most of the records had multiple 999s. In most, there was one 999 field that had an $l field with the value "NASH". I set up the template to first get rid of all 999 fields where the l doeesn't match NASH. It didn't work. If I reverse the action, and write multiple actions that match on every other 999$1 field value, it works. I've tested several different ways, and the only conclusion I can come to is that the "doesn't match" option is failing. I've attached a sample MARC record. -- 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=19069 jfowler@sebts.edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jfowler@sebts.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14568 -- 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=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|14568 | -- 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=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=19069 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 67530 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67530&action=edit Bug 19069: Fix 'does not match' behaviour in MARC modification template The "does not match" condition does not behave as expected. We want it to process the action if the subfield exists and that the value does not match a given pattern. Test plan: Be creative and write different template actions using the "does not match" condition. Using the "Batch record modification" and the "Show MARC" popup, confirm that the processed record is the one you are expecting. -- 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=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Version|17.05 |master Hardware|Macintosh |All OS|Mac OS |All Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I first glance I would say the the "does not exist" condition is buggy as well. -- 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=19069 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |J.P.Knight@lboro.ac.uk --- Comment #3 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Is there a reason for having "does not match" and "does not exist" considering there is the choice of "if" or "unless"? In other words isn't: "Delete field 999 unless 999$l matches NASH" equivalent to "Delete field 999 if 999$l does not match NASH" ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67530|0 |1 is obsolete| | --- Comment #4 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 67972 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67972&action=edit Bug 19069: Fix 'does not match' behaviour in MARC modification template The "does not match" condition does not behave as expected. We want it to process the action if the subfield exists and that the value does not match a given pattern. Test plan: Be creative and write different template actions using the "does not match" condition. Using the "Batch record modification" and the "Show MARC" popup, confirm that the processed record is the one you are expecting. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jon Knight <J.P.Knight@lboro.ac.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67972|0 |1 is obsolete| | --- Comment #5 from Jon Knight <J.P.Knight@lboro.ac.uk> --- Created attachment 67973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=67973&action=edit Bug 19069: Fix 'does not match' behaviour in MARC modification template The "does not match" condition does not behave as expected. We want it to process the action if the subfield exists and that the value does not match a given pattern. Test plan: Be creative and write different template actions using the "does not match" condition. Using the "Batch record modification" and the "Show MARC" popup, confirm that the processed record is the one you are expecting. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jon Knight <J.P.Knight@lboro.ac.uk> 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=19069 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL Koha/MoreUtils.pm FAIL critic Subroutine prototypes used at line 6, column 1. See page 194 of PBP. OK forbidden patterns OK git manipulation OK pod FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 SKIP spelling OK valid -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jon Knight from comment #3)
Is there a reason for having "does not match" and "does not exist" considering there is the choice of "if" or "unless"? In other words isn't:
"Delete field 999 unless 999$l matches NASH"
equivalent to
"Delete field 999 if 999$l does not match NASH"
?
Yes, that sounds definitely valid. Marcel, what do you think? (In reply to Marcel de Rooy from comment #6)
FAIL Koha/MoreUtils.pm
The thing is that this subroutine is a copy/paste of the List::MoreUtils subroutine, but in a newer version. I do not think we should modify it, even for trivial changes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jon Knight from comment #3)
Is there a reason for having "does not match" and "does not exist" considering there is the choice of "if" or "unless"? In other words isn't:
"Delete field 999 unless 999$l matches NASH"
equivalent to
"Delete field 999 if 999$l does not match NASH"
?
Your question and your example do not match. You are not comparing match and exist here. Testing for 245a does [not] exist is different from 245a does [not] match 'test'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #7)
(In reply to Marcel de Rooy from comment #6)
FAIL Koha/MoreUtils.pm
The thing is that this subroutine is a copy/paste of the List::MoreUtils subroutine, but in a newer version. I do not think we should modify it, even for trivial changes.
Good enough -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #10 from Jon Knight <J.P.Knight@lboro.ac.uk> --- (In reply to Marcel de Rooy from comment #8)
(In reply to Jon Knight from comment #3)
Is there a reason for having "does not match" and "does not exist" considering there is the choice of "if" or "unless"? In other words isn't:
"Delete field 999 unless 999$l matches NASH"
equivalent to
"Delete field 999 if 999$l does not match NASH"
?
Your question and your example do not match. You are not comparing match and exist here. Testing for 245a does [not] exist is different from 245a does [not] match 'test'.
The example I used was "match"/"does not match", but the same holds true if we use "exists"/"does not exist" too: "Delete field 999 unless 999$l exists" equivalent to "Delete field 999 if 999$l does not exist" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jon Knight from comment #10)
The example I used was "match"/"does not match", but the same holds true if we use "exists"/"does not exist" too:
"Delete field 999 unless 999$l exists"
equivalent to
"Delete field 999 if 999$l does not exist"
OK. That is of course true. Misunderstood. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #67973|0 |1 is obsolete| | --- Comment #12 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 68693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68693&action=edit Bug 19069: Fix 'does not match' behaviour in MARC modification template The "does not match" condition does not behave as expected. We want it to process the action if the subfield exists and that the value does not match a given pattern. Test plan: Be creative and write different template actions using the "does not match" condition. Using the "Batch record modification" and the "Show MARC" popup, confirm that the processed record is the one you are expecting. Signed-off-by: Jon Knight <J.P.Knight@lboro.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |kyle@bywatersolutions.com |y.org | CC| |kyle@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 17.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 68781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=68781&action=edit Bug 19069: (follow-up) Remove perlcritic error Subroutine prototypes used at line 6, column 1. See page 194 of PBP. (Severity: 5) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #14)
Created attachment 68781 [details] [review] Bug 19069: (follow-up) Remove perlcritic error
Subroutine prototypes used at line 6, column 1. See page 194 of PBP. (Severity: 5)
Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |24900 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 [Bug 24900] Fix 'MARC modification templates' to not assume that 'from field' will match 'conditional field' -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org