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

            Bug ID: 43023
           Summary: A single record with corrupt metadata can break
                    rendering of search results
   Initiative type: ---
        Sponsorship ---
            status:
           Product: Koha
           Version: Main
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5 - low
         Component: Searching
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
        Depends on: 35104
  Target Milestone: ---

Two unguarded MARC decode calls in search result rendering:

1. C4::Search::searchResults (C4/Search.pm), the "scan" search branch, calls
   MARC::Record->new_from_usmarc directly on each raw Zebra scan result with
   no eval.

2. C4::Search::new_record_from_zebra's Elasticsearch fast path (C4/Search.pm)
   returns MARC::Record->new_from_xml($raw_data, 'UTF-8') directly, without
   the eval wrapper that the Zebra dom/grs1 branches further down in the
   same sub already have.

If a corrupted record ends up in the index (e.g. left over from a legacy
import, or synced from a source that had this problem), rendering the
result list can die for that page of results instead of degrading
gracefully for the one bad record.

Found while auditing other places in the codebase that ingest
externally-sourced MARC data, prompted by bug 35104.

Test plan:
1. Get a record with undecodable stored metadata into the search index
   (e.g. via direct DB manipulation of biblio_metadata before reindexing,
   or by reindexing a legacy corrupt record).
2. Run a scan search, and separately a normal search, that includes that
   record among the results, on both a Zebra and an Elasticsearch
   installation.
3. Before a fix: the results page/list can die instead of just omitting or
   flagging that one result.
4. After a fix: the rest of the results render normally.


Referenced Bugs:

https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35104
[Bug 35104] We should warn when attempting to save MARC records that contain
characters invalid in XML
-- 
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