From 4726959974a24c32e8f093908b7a5ef3b60ec643 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 0ef5158d35..0bdfb13039 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -265,9 +265,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 { @@ -284,7 +285,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