[Bug 25006] New: Koha::Item->as_marc_field generates undef subfields
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 Bug ID: 25006 Summary: Koha::Item->as_marc_field generates undef subfields Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Trying to use the EmbedItems RecordProcessor filter for an endpoint, I noticed it got really noisy, and found it is generating subfields even for undefined mapped attributes (on the framework). -- 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=25006 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Depends on| |23807 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23807 [Bug 23807] Add Koha::Item->as_marc_field -- 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=25006 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102016 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102016&action=edit Bug 25006: Regression tests This patch introduces regression tests for as_marc_field. It makes sure there are empty subfields and then uses List::MoreUtils' all to verify all generated MARC subfields contain something (i.e. the undef ones are skipped). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 102017 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102017&action=edit Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields This patch makes as_marc_field skip subfields that don't have a value or contains an empty string (replicating C4::Items:1021 logic). To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Item.t => FAIL: Tests fail because the generated MARC::Field contains undef subfields. 3. Apply this patch 4. Repeat 2. => SUCCESS: Tests pass! Undefined and empty subfields are skipped! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 Tomás Cohen Arazi <tomascohen@gmail.com> 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=25006 David Nind <david@davidnind.com> 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=25006 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102016|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 102051 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102051&action=edit Bug 25006: Regression tests This patch introduces regression tests for as_marc_field. It makes sure there are empty subfields and then uses List::MoreUtils' all to verify all generated MARC subfields contain something (i.e. the undef ones are skipped). Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102017|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 102052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102052&action=edit Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields This patch makes as_marc_field skip subfields that don't have a value or contains an empty string (replicating C4::Items:1021 logic). To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Item.t => FAIL: Tests fail because the generated MARC::Field contains undef subfields. 3. Apply this patch 4. Repeat 2. => SUCCESS: Tests pass! Undefined and empty subfields are skipped! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 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=25006 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #102051|0 |1 is obsolete| | Attachment #102052|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102077 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102077&action=edit Bug 25006: Regression tests This patch introduces regression tests for as_marc_field. It makes sure there are empty subfields and then uses List::MoreUtils' all to verify all generated MARC subfields contain something (i.e. the undef ones are skipped). Signed-off-by: David Nind <david@davidnind.com> 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=25006 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 102078 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=102078&action=edit Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields This patch makes as_marc_field skip subfields that don't have a value or contains an empty string (replicating C4::Items:1021 logic). To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/Koha/Item.t => FAIL: Tests fail because the generated MARC::Field contains undef subfields. 3. Apply this patch 4. Repeat 2. => SUCCESS: Tests pass! Undefined and empty subfields are skipped! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: David Nind <david@davidnind.com> 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=25006 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23247 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23247 [Bug 23247] Simplify visibility logic in opac-MARCdetail.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 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=25006 --- Comment #7 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=25006 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Pushed to stable Version(s)|20.05.00 |20.05.00, 19.11.06 released in| | CC| |joy@bywatersolutions.com --- Comment #8 from Joy Nelson <joy@bywatersolutions.com> --- backported to 19.11.x branch for 19.11.06 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #9 from Lucas Gass <lucas@bywatersolutions.com> --- missing dependencies for 19.05.x, no backport -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25006 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org