From f2f7a4647964a07cfef07d35ef9f91459085cf0a 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 Content-Type: text/plain; charset=utf-8 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 Signed-off-by: Josef Moravec Signed-off-by: Marcel de Rooy --- 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 c1632d5..a514f50 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -421,15 +421,20 @@ sub GetPatronInfo { my $unblessed_hold = $hold->unblessed; # Get additional informations - my $item = GetBiblioFromItemNumber( $hold->itemnumber, undef ); + my $item = Koha::Items->find( $hold->itemnumber ); + my $biblio = $item->biblio; + my $biblioitem = $biblio->biblioitem; my $library = Koha::Libraries->find( $hold->branchcode ); # Should $hold->get_library 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 - $unblessed_hold->{item} = $item; + $unblessed_hold->{item} = { %$item, %$biblio, %$biblioitem }; $unblessed_hold->{branchname} = $branchname; $unblessed_hold->{title} = GetBiblio( $hold->biblionumber )->{'title'}; # Should be $hold->get_biblio -- 2.1.4