Bug 28057: (follow-up) Get the biblionumber column

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>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2021-07-28 17:37:46 +00:00 committed by Kyle M Hall
parent 8258ebe2fb
commit 9fd5d8b778

View file

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