[Bug 42865] New: as_marc_field losing more_subfields_xml data after new MARC mapping
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42865 Bug ID: 42865 Summary: as_marc_field losing more_subfields_xml data after new MARC mapping Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: thibaud.guillot@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz Target Milestone: --- Hello, When a MARC subfield was previously unmapped (its value stored in more_subfields_xml) and a new mapping was added linking it to a Koha items column, running batchRebuildItemsTables.pl would permanently lose the value. -- 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=42865 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- 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=42865 --- Comment #1 from Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> --- Created attachment 200587 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200587&action=edit Bug 42865: Fix as_marc_field losing more_subfields_xml data after new MARC mapping The fix falls back to more_subfields_xml when the mapped DB column is empty, so batchRebuildItemsTables.pl can correctly migrate the value into the newly mapped column. Test plan: 1. Apply this patch 2. With a UNIMARC instance, create or find an item whose 995$z (internal notes) is stored in more_subfields_xml but not mapped: SELECT ExtractValue(more_subfields_xml, '//datafield[@tag="999"]/subfield[@code="z"]') AS "995$z", itemnotes_nonpublic FROM items WHERE biblionumber = <id>; -- Expected: 995$z has a value, itemnotes_nonpublic is NULL 3. Add the MARC mapping 995$z -> items.itemnotes_nonpublic in the framework administration, then clear the cache 4. Run the batch rebuild for the biblionumber: misc/batchRebuildItemsTables.pl -c \ --where "biblio.biblionumber = <id>" 5. Re-run the SELECT from step 1. -- Expected: 995$z is NULL in more_subfields_xml, itemnotes_nonpublic contains the original value 6. Repeat with a MARC21 instance (952$x -> items.itemnotes_nonpublic) to confirm no regression. Sponsored-by: BibLibre -- 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=42865 Thibaud Guillot (thibaud_g) <thibaud.guillot@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |thibaud.guillot@biblibre.co |ity.org |m -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org