@@ -, +, @@ (staff detail) - Import a bibliographic record with invalid XML, you can add non - Go to the detail page --- catalogue/detail.pl | 9 ++++++++- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) --- a/catalogue/detail.pl +++ a/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 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/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 ) %] --