[Bug 31441] New: Koha::Item::as_marc_field ignores subfields where kohafield is an empty string
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Bug ID: 31441 Summary: Koha::Item::as_marc_field ignores subfields where kohafield is an empty string Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org marc_subfield_structure.kohafield can be NULL, but it can also be an empty string. But in that case, Koha::Item::as_marc_field ignores them, which means the resulting MARC::Field object has missing data. This can produce a bug in OPAC ISBD view (and probably other places where this method is used) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 139676 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139676&action=edit Bug 31441: Fix Koha::Item::as_marc_field when kohafield = '' marc_subfield_structure.kohafield can be NULL, but it can also be an empty string. But in that case, Koha::Item::as_marc_field ignores them, which means the resulting MARC::Field object has missing data. This can produce a bug in OPAC ISBD view (and probably other places where this method is used) Test plan: 1. Edit the default biblio MARC framework for the item field: find or create a subfield that is not linked to a DB column. Save even if you made no changes to make sure that marc_subfield_structure.kohafield is set to an empty string. I'll use 995$Z as an example for the following steps. 2. Add the following to syspref OPACISBD: #995|<br>Item:|{995Z}| 3. Create a biblio with an item and put a value into 995$Z 4. Go to the ISBD detail page for this record at OPAC. Confirm that the value you entered in 995$Z is not visible 5. Apply patch and restart koha 6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible. 7. Run `prove t/db_dependent/Koha/Item.t` -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Julian Maurice <julian.maurice@biblibre.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=31441 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=31441 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139676|0 |1 is obsolete| | --- Comment #2 from David Nind <david@davidnind.com> --- Created attachment 140877 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=140877&action=edit Bug 31441: Fix Koha::Item::as_marc_field when kohafield = '' marc_subfield_structure.kohafield can be NULL, but it can also be an empty string. But in that case, Koha::Item::as_marc_field ignores them, which means the resulting MARC::Field object has missing data. This can produce a bug in OPAC ISBD view (and probably other places where this method is used) Test plan: 1. Edit the default biblio MARC framework for the item field: find or create a subfield that is not linked to a DB column. Save even if you made no changes to make sure that marc_subfield_structure.kohafield is set to an empty string. I'll use 995$Z as an example for the following steps. 2. Add the following to syspref OPACISBD: #995|<br>Item:|{995Z}| 3. Create a biblio with an item and put a value into 995$Z 4. Go to the ISBD detail page for this record at OPAC. Confirm that the value you entered in 995$Z is not visible 5. Apply patch and restart koha 6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible. 7. Run `prove t/db_dependent/Koha/Item.t` 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=31441 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #3 from David Nind <david@davidnind.com> --- Testing notes using a MARC21 instance (using koha-testing-docker): 1. I edited an existing subfield 995$z for the BKS framework, and made visible in the OPAC, staff interface, and editor 2. I also created a new subfield 995$Z for the BKS framework, and made visible in the OPAC, staff interface, and editor 3. Initially, everything worked as expected as per the test plan: not displayed in OPAC before the patch was applied. Only tested for OPAC ISBD display. 4. Then I retested again after I signed off just to check the staff interface, and it was displayed correctly without applying the patch on master (flush_memcached, restart_all, cleared browser cache - I also shut down KTD and restarted again, still the same behaviour). 5. I also added the display of the field to the staff interface (ISBD system preference). Has this been fixed some other way, or have I totally screwed up caching/my git clone/testing? Or is it UNIMARC specific? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch 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=31441 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #140877|0 |1 is obsolete| | --- Comment #4 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 141111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=141111&action=edit Bug 31441: Fix Koha::Item::as_marc_field when kohafield = '' marc_subfield_structure.kohafield can be NULL, but it can also be an empty string. But in that case, Koha::Item::as_marc_field ignores them, which means the resulting MARC::Field object has missing data. This can produce a bug in OPAC ISBD view (and probably other places where this method is used) Test plan: 1. Edit the default biblio MARC framework for the item field: find or create a subfield that is not linked to a DB column. Save even if you made no changes to make sure that marc_subfield_structure.kohafield is set to an empty string. I'll use 995$Z as an example for the following steps. 2. Add the following to syspref OPACISBD: #995|<br>Item:|{995Z}| 3. Create a biblio with an item and put a value into 995$Z 4. Go to the ISBD detail page for this record at OPAC. Confirm that the value you entered in 995$Z is not visible 5. Apply patch and restart koha 6. Refresh the ISBD detail page. Confirm that the 995$Z is now visible. 7. Run `prove t/db_dependent/Koha/Item.t` Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to David Nind from comment #3)
Has this been fixed some other way, or have I totally screwed up caching/my git clone/testing? Or is it UNIMARC specific?
Koha/Filter/MARC/EmbedItems.pm: push @item_fields, $item->as_marc_field( { mss => $mss } ); opac/opac-ISBDdetail.pl: { filters => [ 'EmbedItems', 'ViewPolicy' ], Use of as_marc_field is not very widespread. catalogue/ISBDdetail.pl does not use it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |22.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|22.11.00 |22.11.00, 22.05.08 released in| | --- Comment #7 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcomiong 22.05.08 release -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 Arthur Suzuki <arthur.suzuki@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.08 |22.11.00, 22.05.08, released in| |21.11.15 CC| |arthur.suzuki@biblibre.com Status|Pushed to oldstable |Pushed to oldoldstable --- Comment #8 from Arthur Suzuki <arthur.suzuki@biblibre.com> --- applied to 21.11 for 21.11.15 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31441 wainuiwitikapark@catalyst.net.nz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #9 from wainuiwitikapark@catalyst.net.nz --- Not backported to 21.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org