View | Details | Raw Unified | Return to bug 33497
Collapse All | Expand All

(-)a/Koha/Biblio.pm (-4 / +3 lines)
Lines 478-488 sub items { Link Here
478
478
479
    return Koha::Items->_new_from_dbic( $items_rs ) unless $params->{host_items};
479
    return Koha::Items->_new_from_dbic( $items_rs ) unless $params->{host_items};
480
480
481
    my @itemnumbers = $items_rs->get_column('itemnumber')->all;
481
    my $host_itemnumbers = $self->_host_itemnumbers();
482
    my $host_itemnumbers = $self->_host_itemnumbers();
482
    my $search_params = { -or => [biblionumber => $self->id] };
483
    push @itemnumbers, @{ $host_itemnumbers };
483
    push @{$search_params->{'-or'}}, itemnumber => { -in => $host_itemnumbers } if $host_itemnumbers;
484
    return Koha::Items->search({ "me.itemnumber" => { -in => \@itemnumbers } });
484
485
    return Koha::Items->search($search_params);
486
}
485
}
487
486
488
=head3 host_items
487
=head3 host_items
(-)a/catalogue/detail.pl (-2 / +1 lines)
Lines 193-199 my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_loc Link Here
193
my $params;
193
my $params;
194
my $patron = Koha::Patrons->find( $borrowernumber );
194
my $patron = Koha::Patrons->find( $borrowernumber );
195
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
195
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
196
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfers'] } );
196
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfer'] } );
197
197
198
# flag indicating existence of at least one item linked via a host record
198
# flag indicating existence of at least one item linked via a host record
199
my $hostrecords = $biblio->host_items->count;
199
my $hostrecords = $biblio->host_items->count;
200
- 

Return to bug 33497