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>
( $biblioitem->{biblioitemnumber} => $biblioitem )
} @{ Koha::Biblioitems->search(
{ biblioitemnumber => { -in => \@biblioitemnumbers } },
- { select => ['biblioitemnumber', 'publicationyear', 'itemtype']}
+ { select => ['biblionumber', 'biblioitemnumber', 'publicationyear', 'itemtype']}
)->unblessed
}
};
# 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;