When a record cannot be decoded Koha shows a 500 error to the user. The code throws a Koha::Exceptions::Metadata::Invalid which is recorded in the plack-error We should catch the exception and provide a better message to the user. Often, these records will load in the editor, we should provide a link to the user so they can attempt to fix the record Alternately, we should attempt to assume the record is encoded in a different format (marc8) and attempt to convert uft-8
This would be much more helpful than the 500 Error.
Created attachment 130104 [details] [review] Bug 29970: eval processing of MARC record to avoid crash detail.pl displays a warning at the top of the page when a record contains parsing errors Bug 28734 and bug 11175 added additional parsing of the MARC record, but they did not catch the thrown errors. The existing pattern in the script is to eval responses to avoid crashing This patch wraps the new calls in eval{} To test: 1 - Find a record in the staff catalog 2 - Edit the record 3 - In the 520 notes field, add an ASCII escape character (27 decimal, 1b hex) On ubuntu Ctrl+Shift+u, then 1b, enter 4 - Save the record 5 - 500 Error 6 - Apply patch 7 - Reload 8 - The record displays with a warning at the top
I don't understand, we were supposed to have fixed that few days ago, with bug 29690. If the problem still persists, please have a look at the solution there (test $marc_record)
You patch does not apply, I think it's a duplicate. *** This bug has been marked as a duplicate of bug 29690 ***