diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 3e2ca01cf5..511855e9fc 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -112,6 +112,9 @@ if ( not defined $record ) { exit; } +eval { $biblio->metadata->record }; +$template->param( decoding_error => $@ ); + if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( @@ -143,7 +146,11 @@ if ( $xslfile ) { } $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); -$template->param( ocoins => $biblio->get_coins ); + +# Catch the exception as Koha::Biblio::Metadata->record can explode if the MARCXML is invalid +# Do not propagate it as we already deal with it previously in this script +my $coins = eval { $biblio->get_coins }; +$template->param( ocoins => $coins ); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in 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 d7fc0ec3f2..5da7b95c18 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -68,6 +68,12 @@ [% CoceHost = Koha.Preference('CoceHost') %] [% INCLUDE 'cat-toolbar.inc' %] + [% IF decoding_error %] +
+ There is an error with this bibliographic record, the view may be degraded. +
Error: [% decoding_error %] +
+ [% END %] [% IF ( ocoins ) %]