From 51e2cbf7434da23884c1a2984d5c4b40f04e5201 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 15 Mar 2017 10:41:29 -0300 Subject: [PATCH] Bug 18276: Remove GetBiblioFromItemNumber - ILSDI Test plan: Hit /cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=51&show_holds=1 The results should be the same before and after this patch --- C4/ILSDI/Services.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index 287ac02..0e8663c 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -418,15 +418,20 @@ sub GetPatronInfo { foreach my $reserve (@reserves) { # Get additional informations - my $item = GetBiblioFromItemNumber( $reserve->{'itemnumber'}, undef ); + my $item = Koha::Items->find( $reserve->{itemnumber} ); + my $biblio = $item->biblio; + my $biblioitem = $biblio->biblioitem; my $library = Koha::Libraries->find( $reserve->{branchcode} ); my $branchname = $library ? $library->branchname : ''; # Remove unwanted fields + $item = $item->unblessed; delete $item->{'more_subfields_xml'}; + $biblio = $biblio->unblessed; + $biblioitem = $biblioitem->unblessed; # Add additional fields - $reserve->{'item'} = $item; + $reserve->{'item'} = { %$item, %$biblio, %$biblioitem }; $reserve->{'branchname'} = $branchname; $reserve->{'title'} = GetBiblio( $reserve->{'biblionumber'} )->{'title'}; } -- 2.9.3