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

--- Comment #36 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 210052
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210052&action=edit
Bug 43028: Do not drop or duplicate records when staging a MARCXML file with a
bad record

RecordsFromMARCXMLFile kept the record variable across iterations, so
when a record could not be parsed the previous record was added a
second time, and when the first record could not be parsed the loop
ended there and every record after it was lost.

Read each record in its own scope, report the ones that cannot be
parsed, and carry on with the next one. The end of the file is still
only a record that is missing without an error, and a parser that keeps
failing with the same error stops the loop.

To test:
1. Stage a MARCXML file with three records where the second contains a
   character reference to a control character, e.g.
   <subfield code="a">Bad&#x1F;record</subfield>
   => Before: the first record is staged twice and the error is
      not tied to any record.
   => After: the first and third records are staged, and the error is
      reported.
2. prove t/ImportBatch.t

Sponsored-by: OpenFifth

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
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/

Reply via email to