From 561c1015f7c6eba26e274ae32f08d1599ec0f00d 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 --- C4/XSLT.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index f53093d868..9179199013 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -266,9 +266,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 { @@ -285,7 +286,7 @@ sub XSLTParse4Display { my $partsxml = ''; # possibly insert component records into Detail views if ($xslsyspref =~ m/Details/) { - my $biblio = Koha::Biblios->find( $biblionumber ); + $biblio //= Koha::Biblios->find( $biblionumber ); my $components = $biblio->get_marc_analytics(300); $variables->{show_analytics_link} = ( scalar @{$components} == 0 ) ? 0 : 1; -- 2.20.1