Bug 14598 [QA Followup] - Only fetch bib data if needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
This commit is contained in:
Kyle M Hall 2015-11-20 14:23:22 +00:00 committed by Mason James
parent c28704e573
commit 8a919ef2bd
1 changed files with 4 additions and 4 deletions

View File

@ -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}) {