Bug 28057: (follow-up) Get the biblionumber column
authorNick Clemens <nick@bywatersolutions.com>
Wed, 28 Jul 2021 17:37:46 +0000 (17:37 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 4 Aug 2021 07:14:02 +0000 (09:14 +0200)
When we fetch the biblioitems we use a select to limit the columns fetched,
we must include the biblionumber as well

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
reserve/request.pl

index 1a027d2..00b7b66 100755 (executable)
@@ -421,7 +421,7 @@ foreach my $biblionumber (@biblionumbers) {
             ( $biblioitem->{biblioitemnumber} => $biblioitem )
           } @{ Koha::Biblioitems->search(
                 { biblioitemnumber => { -in => \@biblioitemnumbers } },
-                { select => ['biblioitemnumber', 'publicationyear', 'itemtype']}
+                { select => ['biblionumber', 'biblioitemnumber', 'publicationyear', 'itemtype']}
             )->unblessed
           }
     };
@@ -459,7 +459,6 @@ foreach my $biblionumber (@biblionumbers) {
         # it's complicated logic to analyse.
         # (before this loop was inside that sub loop so it was O(n^2) )
         my $items_any_available;
-
         $items_any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblioitem->{biblionumber}, patron => $patron })
             if $patron;