From 983c4690d97e117976de9f4ff467ee9e4934e0e1 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 --- C4/Circulation.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f7392bf..238d562 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1863,10 +1863,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.7.4