From 412f22e4ad60de83cee26d80830491a9a7327c79 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 6 Aug 2021 13:00:29 +0100 Subject: [PATCH] Bug 11175: (QA follow-up) Only get biblio once Signed-off-by: Martin Renvoize Signed-off-by: Andrew Nugged Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- C4/XSLT.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 8f216852ac..ab7fa502a1 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -264,9 +264,10 @@ sub XSLTParse4Display { my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); $variables ||= {}; + my $biblio; if (C4::Context->preference('OPACShowOpenURL')) { my @biblio_itemtypes; - my $biblio = Koha::Biblios->find($biblionumber); + $biblio //= Koha::Biblios->find($biblionumber); if (C4::Context->preference('item-level_itypes')) { @biblio_itemtypes = $biblio->items->get_column("itype"); } else { @@ -283,7 +284,7 @@ sub XSLTParse4Display { my $partsxml = ''; # possibly insert component records into Detail views if ( $xslsyspref eq "OPACXSLTDetailsDisplay" || $xslsyspref eq "XSLTDetailsDisplay" ) { - my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblio //= Koha::Biblios->find( $biblionumber ); my $components = $biblio->get_marc_components(300); $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1; -- 2.39.5