From 4384e081968c7dd9c95c34d78bda2eba199a3243 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 20 Nov 2015 14:23:22 +0000 Subject: [PATCH] Bug 14598 [QA Followup] - Only fetch bib data if needed Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall --- C4/Circulation.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 848d6e6a54..40fdcfdc5e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1855,10 +1855,10 @@ sub AddReturn { } my $itemnumber = $item->{ itemnumber }; - my $biblio = GetBiblioData( $item->{ biblionumber } ); - my $itemtype = ( C4::Context->preference("item-level_itypes") ) - ? $item->{ itype } - : $biblio->{ itemtype }; + + my $item_level_itypes = C4::Context->preference("item-level_itypes"); + my $biblio = $item_level_itypes ? undef : GetBiblioData( $item->{ biblionumber } ); # don't get bib data unless we need it + my $itemtype = $item_level_itypes ? $item->{itype} : $biblio->{itemtype}; my $issue = GetItemIssue($itemnumber); if ($issue and $issue->{borrowernumber}) { -- 2.39.5