https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41843 --- Comment #2 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 196625 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196625&action=edit Bug 41843: GRacefully handle xml errors during authority deletion This patch updates move_to_deleted in Koha::Authorities to attempt to handle encoding errors and delete a record with invalid marcxml. If recoverable, the leader of the deletd record will be updated to reflect deletion , but in the case it cannot the XML will be saved unaltered. To test: 1 - Find an authority record that is not used in your Koha More->Authorities, search for 'a' Record #1541 for example 2 - Make the record have errors: sudo koha-mysql kohadev UPDATE auth_header SET marcxml = UpdateXML(marcxml, '//datafield[@tag="040"]/subfield[@code="c"]',CONCAT('<subfield code',CHAR(27),'="c">OSt</subfield>')) WHERE auth_header.authid=1541; 3 - In the search results, click Actions->Delete 4 - Error 500! 5 - Apply patch, restart all 6 - Delete the record 7 - Success! -- You are receiving this mail because: You are watching all bug changes.