https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44074
Bug ID: 44074
Summary: Koha::Item columns_to_str and additional_attributes do
not guard undecodable more_subfields_xml
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P5 - low
Component: Cataloging
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected]
Target Milestone: ---
Follow-up to bug 43024.
Bug 43024 guards the paths it names against undecodable MARC. The same class of
problem exists in Koha/Item.pm, which decodes the items.more_subfields_xml
column with no error handling:
- columns_to_str: MARC::Record->new_from_xml( $self->more_subfields_xml,
'UTF-8' ) is called without an eval, so one item with corrupt
more_subfields_xml makes the whole call die.
- additional_attributes: Koha::Item::Attributes->new_from_marcxml(
$self->more_subfields_xml ) should be checked for the same weakness.
Fix: guard these calls the same way bug 43024 guards
C4::Items::_parse_unlinked_item_subfields_from_xml (catch the error, log it
with the itemnumber through Koha::Logger, and carry on without the unlinked
subfields).
Test plan:
1. Apply the patch (and bug 43024).
2. Corrupt an item's more_subfields_xml directly in the database.
3. View the record or call the code paths that use columns_to_str and
additional_attributes for that item.
4. Confirm the page or call still works, the item is shown without its unlinked
subfields, and the problem is logged.
5. prove t/db_dependent/Koha/Item.t
Sponsored-by: OpenFifth
--
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]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/