[Bug 24900] New: 'MARC modification templates' does not delete all fields if there is a condition in template
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Bug ID: 24900 Summary: 'MARC modification templates' does not delete all fields if there is a condition in template Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Tools Assignee: koha-bugs@lists.koha-community.org Reporter: aleisha@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org Created attachment 100992 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100992&action=edit test record To reproduce: Download the attached biblio record (try right-clicking -> save link as) Create a MARC modification template with the following action: Delete field 020 if field 020$z exists Import the record (Tools -> Stage MARC record for import) Under Use MARC modification template, select your template to modify the record Stage for import Once complete, go to Manage staged records Click the staged record to view the MARC Confirm only the 020$z field was deleted, even though we wanted all 020 fields to be deleted -- 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=24900 --- Comment #1 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 100993 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100993&action=edit Bug 24900: If condition in template, check for existence of from fields in MARC record This patch checks the existence of 'from fields' in the record, as defined in the template, if the template includes a condition. To test: Follow plan to reproduce the bug Apply the patch and go back to import the record (Tools -> Stage MARC record for import) Under Use MARC modification template, select your template to modify the record Stage for import Once complete, go to Manage staged records Click the staged record to view the MARC Confirm all 020 fields were deleted, as expected Sponsored-by: Catalyst IT -- 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=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |aleisha@catalyst.net.nz |ity.org | --- Comment #2 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Tests coming -- 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=24900 Andreas Roussos <a.roussos@dataly.gr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |a.roussos@dataly.gr -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #100993|0 |1 is obsolete| | --- Comment #3 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 101665 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101665&action=edit Bug 24900: Some fixes to how MARC modification template actions work CASE 1: Delete field 020 if field 020$z exists BROKEN BEHAVIOUR (before patch): 020$z field was deleted, even though we wanted all 020 fields to be deleted EXPECTED BEHAVIOUR (corrected by patch): all 020 fields are deleted CASE 2: Delete 1st field 020 if 651$z exists BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead of 1st EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 3: Delete 1st field 020 if 020$z exists BROKEN BEHAVIOUR (before patch): deletes the 3rd instance of 020 which contains subfield z EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 4: Delete 1st field 020 if 651$z matches Berlin. (must include '.') BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 5: Delete 1st field 020 if 020$z matches 9781460708385 BROKEN BEHAVIOUR (before patch): deletes the 3rd instance of 020 which contains subfield z EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 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=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101665|0 |1 is obsolete| | --- Comment #4 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 101666 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101666&action=edit Bug 24900: Checks in MARC mod templates for when from field does not equal conditional field When MARC modification template actions are applied, they assume that the from field is the same as the conditional field. This patch adds checks for this, as well as tests to confirm the behaviour is correct. CASE 1: Delete 1st field 020 if 651$z exists BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead of 1st EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 2: Delete 1st field 020 if 651$z matches Berlin. (must include '.') BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 3: Delete field 020 if 650$2 does not match fast BROKEN BEHAVIOUR (before patch): deletes all 020 fields even though 650$2 does match fast EXPECTED BEHAVIOUR (corrected by patch): does not delete 020 fields Confirm tests pass: t/db_dependent/MarcModificationTemplates.t 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=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|'MARC modification |Fix 'MARC modification |templates' does not delete |templates' to not assume |all fields if there is a |that 'from field' will |condition in template |match 'conditional field' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This patch ensures MARC release notes| |modification template | |actions work as expected | |when the 'from field' | |doesn't match the | |'conditional field'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org QA Contact|testopia@bugs.koha-communit |jonathan.druart@bugs.koha-c |y.org |ommunity.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Frank Hansen <frank.hansen@ub.lu.se> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frank.hansen@ub.lu.se -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 --- Comment #5 from Frank Hansen <frank.hansen@ub.lu.se> --- (In reply to Aleisha Amohia from comment #4)
Created attachment 101666 [details] [review] Bug 24900: Checks in MARC mod templates for when from field does not equal conditional field
When MARC modification template actions are applied, they assume that the from field is the same as the conditional field. This patch adds checks for this, as well as tests to confirm the behaviour is correct.
CASE 1: Delete 1st field 020 if 651$z exists BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead of 1st EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020
CASE 2: Delete 1st field 020 if 651$z matches Berlin. (must include '.') BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020
CASE 3: Delete field 020 if 650$2 does not match fast BROKEN BEHAVIOUR (before patch): deletes all 020 fields even though 650$2 does match fast EXPECTED BEHAVIOUR (corrected by patch): does not delete 020 fields
Confirm tests pass: t/db_dependent/MarcModificationTemplates.t
Sponsored-by: Catalyst IT
What I can see, this patch does as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101666|0 |1 is obsolete| | --- Comment #6 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 101970 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101970&action=edit Bug 24900: Checks in MARC mod templates for when from field does not equal conditional field When MARC modification template actions are applied, they assume that the from field is the same as the conditional field. This patch adds checks for this, as well as tests to confirm the behaviour is correct. CASE 1: Delete 1st field 020 if 651$z exists BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead of 1st EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 2: Delete 1st field 020 if 651$z matches Berlin. (must include '.') BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 3: Delete field 020 if 650$2 does not match fast BROKEN BEHAVIOUR (before patch): deletes all 020 fields even though 650$2 does match fast EXPECTED BEHAVIOUR (corrected by patch): does not delete 020 fields Confirm tests pass: t/db_dependent/MarcModificationTemplates.t Sponsored-by: Catalyst IT Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |david@davidnind.com --- Comment #7 from David Nind <david@davidnind.com> --- Changed status to signed off - looks like Frank Hansen signed this on off to me! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |19069 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Great fix Aleisha! Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19069 [Bug 19069] "Doesn't match" option fails in MARC Modification Templates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=24900 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #101970|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102121&action=edit Bug 24900: Checks in MARC mod templates for when from field does not equal conditional field When MARC modification template actions are applied, they assume that the from field is the same as the conditional field. This patch adds checks for this, as well as tests to confirm the behaviour is correct. CASE 1: Delete 1st field 020 if 651$z exists BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead of 1st EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 2: Delete 1st field 020 if 651$z matches Berlin. (must include '.') BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020 CASE 3: Delete field 020 if 650$2 does not match fast BROKEN BEHAVIOUR (before patch): deletes all 020 fields even though 650$2 does match fast EXPECTED BEHAVIOUR (corrected by patch): does not delete 020 fields Confirm tests pass: t/db_dependent/MarcModificationTemplates.t Sponsored-by: Catalyst IT Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.05.00 released in| | Status|Passed QA |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=24900 --- Comment #10 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24900 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com --- Comment #11 from Joy Nelson <joy@bywatersolutions.com> --- Tests don't apply cleanly to 19.11.x branch. Please rebase if needed in 19.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org