From 2ea78aeee2d6fd3e6a5be3218d537859506e69fc Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Oct 2021 13:42:34 +0200 Subject: [PATCH] Bug 29307: Remove unecessary marc record fetch on detail.pl We were fetching the MARC::Record twice here. Signed-off-by: David Nind --- catalogue/detail.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index b5801cca71..2fb8da28ae 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -83,10 +83,12 @@ if ( C4::Context->config('enable_plugins') ) { my $biblionumber = $query->param('biblionumber'); $biblionumber = HTML::Entities::encode($biblionumber); -my $record = GetMarcBiblio({ biblionumber => $biblionumber }); my $biblio = Koha::Biblios->find( $biblionumber ); $template->param( 'biblio', $biblio ); +my $record = eval { $biblio->metadata->record }; +$template->param( decoding_error => $@ ); + if ( not defined $record ) { # biblionumber invalid -> report and exit $template->param( unknownbiblionumber => 1, @@ -95,8 +97,6 @@ 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") ); -- 2.20.1