Bug 18276: Remove GetBiblioFromItemNumber - ILSDI
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Mar 2017 13:41:29 +0000 (10:41 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 10 Jul 2017 15:09:24 +0000 (12:09 -0300)
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 <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

C4/ILSDI/Services.pm

index d4d8a96..77ac135 100644 (file)
@@ -423,15 +423,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