From 828a9ecd2983f9117af3852dbf834f09bfd0471e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 18:18:23 +0100 Subject: [PATCH] Bug 23846: Handle exception gracefully at the OPAC I do not think we should have the same trick as the intranet, and display a message. This should be enough. Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize (cherry picked from commit cce358f9af5ee9761a875816f603344873838359) Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- misc/maintenance/search_for_data_inconsistencies.pl | 1 + opac/opac-detail.pl | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 9f145d5ad9..341880fcb8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -67,7 +67,7 @@ [% IF decoding_error %]
There is an error with this bibliographic record, the view may be degraded. -
Error: [% decoding_error %] +
Error: [% decoding_error | html %]
[% END %] [% IF ( ocoins ) %] diff --git a/misc/maintenance/search_for_data_inconsistencies.pl b/misc/maintenance/search_for_data_inconsistencies.pl index 3fc6eceb20..02f66f21d3 100755 --- a/misc/maintenance/search_for_data_inconsistencies.pl +++ b/misc/maintenance/search_for_data_inconsistencies.pl @@ -154,4 +154,5 @@ Catch data inconsistencies in Koha database then items.itype must be set else biblioitems.itemtype must be set * Item types defined in items or biblioitems must be defined in the itemtypes table * Invalid MARCXML in bibliographic records + =cut diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 11491182c8..82438e5854 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -846,8 +846,10 @@ $template->param( content_identifier_exists => $content_identifier_exists, ); +# Catch the exception as Koha::Biblio::Metadata->record can explode if the MARCXML is invalid # COinS format FIXME: for books Only -$template->param( ocoins => $biblio->get_coins ); +my $coins = eval { $biblio->get_coins }; +$template->param( ocoins => $coins ); my ( $loggedincommenter, $reviews ); if ( C4::Context->preference('reviewson') ) { -- 2.39.5