[Koha-bugs] [Bug 24827] MARC preview fails when staged record contains items with UTF-8 characters

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 9 18:55:17 CET 2020


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

Owen Leonard <oleonard at myacpl.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #100320|0                           |1
        is obsolete|                            |

--- Comment #5 from Owen Leonard <oleonard at myacpl.org> ---
Created attachment 100410
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=100410&action=edit
Bug 24827: Specify UTF-8 as encoding in new_from_xml()

The MARC preview of staged records fails when a staged record contains
items with UTF-8 characters (see attached screenshots). That's because
in EmbedItemsInImportBiblio() the call to MARC::Record->new_from_xml()
does not explicitly specify 'UTF-8' as the optional encoding to use.

This patch fixes that, and also standardises the encoding name used in
direct calls to new_from_xml() to 'UTF-8' instead of 'utf8' or 'utf-8'.

Test plan (in a MARC21 instance):
0) Stage for import the test record attached to this bug report (make
   sure that 'Check for embedded item record data?' is set to 'Yes'),
   then go to Home > Tools > Manage staged MARC records and click on
   the filename you've just staged.
1) In the 'Citation' column, click on the hyperlink to launch the MARC
   preview -- notice how it fails to produce any output apart from the
   modal heading.
2) Apply the patch, and restart Plack if necessary.
3) Re-launch the MARC preview: this time the output should include the
   whole record, including the embedded item data in field 952.
4) Run the unit tests to ensure nothing was broken inadvertently:
   $ prove t
   $ prove xt

Signed-off-by: Owen Leonard <oleonard at myacpl.org>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list