Bug 29690: Prevent detail.pl to crash if MARCXML is invalid
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Jan 2022 05:21:15 +0000 (06:21 +0100)
committerKyle Hall <kyle@bywatersolutions.com>
Mon, 7 Feb 2022 14:43:40 +0000 (09:43 -0500)
commit8a93db673356b70364b22572c5f893fea154040f
tree2b43d78d54f09bc9d13b8d71045056c36bd39550
parente655f0dd5a0a285fdc5b9463c49952d9b1dfea60
Bug 29690: Prevent detail.pl to crash if MARCXML is invalid

Bug 23846 added support for invalid MARCXML.
But now page details.pl fails again with software error.
This comes from several Koha::Biblio calling $self->metadata->record without eval.

Test plan :
1) Create a biblio record with invalid MARCXML (see Bug 29690)
In koha-testing-docker there is biblionumber=369
2) Go to page cgi-bin/koha/catalogue/detail.pl?biblionumber=xxx
3) You see the page with a message :
There is an error with this bibliographic record, the view may be degraded.
Error: Invalid data, cannot decode metadata object ...

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
catalogue/detail.pl