Summary: | Bad characters in MARC cause internal server error when searching catalog | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Architecture, internals, and plumbing | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | major | ||
Priority: | P5 - low | CC: | 1joynelson, danielle, jonathan.druart, liz, lucas, wizzyrea |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23846 | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.05.00, 19.11.01
|
|
Circulation function: | |||
Attachments: |
Bug 24243: Do not explode if invalid metadata when searching catalogue
Bug 24243: Do not explode if invalid metadata when searching catalogue Bug 24243: Do not explode if invalid metadata when searching catalogue |
Description
Nick Clemens (kidclamp)
2019-12-13 18:30:08 UTC
Created attachment 96295 [details] [review] Bug 24243: Do not explode if invalid metadata when searching catalogue If the bibliographic record metadata cannot be decoded, the get_coins call should catch the exception raised by Koha::Biblio::Metadata->record to not explode Error is: "Invalid data, cannot decode objec" Test plan: 0/ Do not apply the patch 1/ Search for record at the OPAC 2/ Note one of the biblionumber from the first page result 3/ Set to empty string the biblio_metadata to make the error appears: update biblio_metadata set metadata="" where biblionumber=42; 4/ Try the same search => You get an internal server error 5/ Apply the patch, restart plack and try again => It now works, ie. it does not explode this happens in the record exporter as well. Created attachment 96340 [details] [review] Bug 24243: Do not explode if invalid metadata when searching catalogue If the bibliographic record metadata cannot be decoded, the get_coins call should catch the exception raised by Koha::Biblio::Metadata->record to not explode Error is: "Invalid data, cannot decode objec" Test plan: 0/ Do not apply the patch 1/ Search for record at the OPAC 2/ Note one of the biblionumber from the first page result 3/ Set to empty string the biblio_metadata to make the error appears: update biblio_metadata set metadata="" where biblionumber=42; 4/ Try the same search => You get an internal server error 5/ Apply the patch, restart plack and try again => It now works, ie. it does not explode Signed-off-by: Liz Rea <wizzyrea@gmail.com> Shouldn't we log the error? (In reply to Nick Clemens from comment #4) > Shouldn't we log the error? There is a check in search_for_data_inconsistencies.pl, so I'd say it's not needed. From a troubleshooting point of view, that would be nice. There will be a warning on the detail page of the problematic record anyway (from bug 23846) Created attachment 96573 [details] [review] Bug 24243: Do not explode if invalid metadata when searching catalogue If the bibliographic record metadata cannot be decoded, the get_coins call should catch the exception raised by Koha::Biblio::Metadata->record to not explode Error is: "Invalid data, cannot decode objec" Test plan: 0/ Do not apply the patch 1/ Search for record at the OPAC 2/ Note one of the biblionumber from the first page result 3/ Set to empty string the biblio_metadata to make the error appears: update biblio_metadata set metadata="" where biblionumber=42; 4/ Try the same search => You get an internal server error 5/ Apply the patch, restart plack and try again => It now works, ie. it does not explode Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Maybe we should think about displaying a more specific error, currently in the intranet you see: The record you requested does not exist (2). It's not quite correct. Nice work everyone! Pushed to master for 20.05 backported to 19.11.x for 19.11.01 backported to 19.05.x for 19.05.06 Pushed to 19.11.01 |