From 8a493862344eea53ae7229a84f6aea92cdc98fd4 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 19 Jul 2023 10:51:34 +0100 Subject: [PATCH] Revert "Bug 33497: Add a filter relationship for branchtransfers" This reverts commit f3890f6cb281e61d51c0712f10f9686e6c84556c. --- Koha/Biblio.pm | 7 ++++--- catalogue/detail.pl | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index da3f623230..a0a70197a9 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -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 diff --git a/catalogue/detail.pl b/catalogue/detail.pl index c47b9b44a8..3cd9dd7cb9 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -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; -- 2.39.5