From 0b4b871f6dcdf6e327fd46e2d1d4cd501969f8a1 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 20 Jul 2023 08:41:00 +0000 Subject: [PATCH] Bug 33167: (RMAINT fix) Revert 33167 Bug 33167 was reverted from 22.11.x but the revert does not seem to have removed all lines causing failing tests. This patch removes remaining lines and refactors the code to its pre-33167 state --- catalogue/detail.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 1f6abecd73..f8b6d04237 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -193,8 +193,12 @@ my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_loc 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->search_ordered( $params )->as_list; +while ( my $item = $all_items->next ) { + push @items, $item + unless $item->itemlost + && $patron->category->hidelostitems + && !$showallitems; +} # flag indicating existence of at least one item linked via a host record my $hostrecords; @@ -206,9 +210,6 @@ if ( $hostitems->count ) { } my $dat = &GetBiblioData($biblionumber); -$dat->{'count'} = $biblio->items->count + $hostitems->count; -$dat->{'showncount'} = scalar @items; -$dat->{'hiddencount'} = $dat->{'count'} - $dat->{'showncount'}; #is biblio a collection and are bundles enabled my $leader = $marc_record->leader(); -- 2.39.2