Revert "Bug 33497: Add a filter relationship for branchtransfers"

This reverts commit f3890f6cb2.
This commit is contained in:
Matt Blenkinsop 2023-07-19 10:51:34 +01:00
parent 545a92bd98
commit 8a49386234
2 changed files with 5 additions and 4 deletions

View File

@ -479,10 +479,11 @@ sub items {
return Koha::Items->_new_from_dbic( $items_rs ) unless $params->{host_items};
my @itemnumbers = $items_rs->get_column('itemnumber')->all;
my $host_itemnumbers = $self->_host_itemnumbers();
push @itemnumbers, @{ $host_itemnumbers };
return Koha::Items->search({ "me.itemnumber" => { -in => \@itemnumbers } });
my $search_params = { -or => [biblionumber => $self->id] };
push @{$search_params->{'-or'}}, itemnumber => { -in => $host_itemnumbers } if $host_itemnumbers;
return Koha::Items->search($search_params);
}
=head3 host_items

View File

@ -194,7 +194,7 @@ my $all_items = $biblio->items->search_ordered;
my @items;
my $patron = Koha::Patrons->find( $borrowernumber );
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfer'] } );
my $items = $biblio->items({ host_items => 1 })->search_ordered( $params, { prefetch => ['issue','branchtransfers'] } );
# flag indicating existence of at least one item linked via a host record
my $hostrecords = $biblio->host_items->count;