From c29b60fb268640d4fdbc40dcb0ca8c15f83c5822 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 (cherry picked from commit 4384e081968c7dd9c95c34d78bda2eba199a3243) Signed-off-by: Julian Maurice --- C4/Circulation.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 0e6e0c2533..70370d7cf3 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1833,10 +1833,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