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

--- Comment #35 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 210051
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210051&action=edit
Bug 43028: Isolate a corrupt record in the catalog when overlaying

When a batch overlays an existing record that is itself corrupt in the
catalog, the old record was decoded outside of the per-record
isolation. A single bad catalog record made BatchCommitRecords die,
leaving the whole batch in 'importing' state, where it could neither be
completed nor reverted.

Read the record being replaced through Koha::Biblio::Metadata->record,
which repairs what can be repaired, and report what cannot as an error
on that import record only. Any other unexpected exception raised while
importing a record is now also reported against that record (and
logged), so the remaining records are still imported and the batch ends
in 'imported' state.

To test:
1. Stage a batch overlaying existing records, then corrupt the catalog
   records it matches (e.g. blank <datafield tag="500"...></datafield>,
   a control character in a subfield, or truncated XML).
2. Commit the batch.
   => Before: the commit dies and the batch stays 'importing'.
   => After: repairable records are overlaid, unrepairable ones are
      flagged 'error' with the reason, the batch is 'imported' and can
      be reverted.
3. prove t/db_dependent/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