Summary: | Koha::Item->as_marc_field generates undef subfields | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Architecture, internals, and plumbing | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | 1joynelson, lucas |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00, 19.11.06
|
|
Circulation function: | |||
Bug Depends on: | 23807 | ||
Bug Blocks: | 23247 | ||
Attachments: |
Bug 25006: Regression tests
Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields Bug 25006: Regression tests Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields Bug 25006: Regression tests Bug 25006: Make Koha::Item->as_marc_field skip undefined subfields |
Description
Tomás Cohen Arazi (tcohen)
2020-03-27 19:35:45 UTC
Created attachment 102016 [details] [review] 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). Created attachment 102017 [details] [review] 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> Created attachment 102051 [details] [review] 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> Created attachment 102052 [details] [review] 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> Created attachment 102077 [details] [review] 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> Created attachment 102078 [details] [review] 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> Nice work everyone! Pushed to master for 20.05 backported to 19.11.x branch for 19.11.06 missing dependencies for 19.05.x, no backport |