From 8a919ef2bd216483b5e388c4eecab9075ec39aac 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: Mason James --- C4/Circulation.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 2bcff6200d..5d91a85cd2 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1819,10 +1819,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