https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42865

--- Comment #1 from Thibaud Guillot (thibaud_g) <[email protected]> 
---
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.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to