From b2d5999ec32633bff4e7f3c9cf2da75e21c0eadc Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 26 Aug 2021 09:41:48 -0300 Subject: [PATCH] Bug 28906: (26223 follow-up) Remove use of as_list This bug makes Koha::Items->filter_by_visible_in_opac honour list context, so this explicit call is not needed. To test: 1. Pick a biblio in the OPAC 2. Go to the ISBD view => SUCCESS: It renders correctly 3. Apply this patch and restart Plack 4. Refresh the ISBD view page => SUCCESS: It doesn't break! 5. Check opac-reserve.pl doesn't break either 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- opac/opac-ISBDdetail.pl | 2 +- opac/opac-reserve.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 47fcb5e852f..41119b35218 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -99,7 +99,7 @@ unless ( $patron and $patron->category->override_hidden_items ) { } my $record = $biblio->metadata->record; -my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron })->as_list; +my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); my $record_processor = Koha::RecordProcessor->new( { filters => [ 'EmbedItems', 'ViewPolicy' ], diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 721981bb2a0..11682d76ff4 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -461,7 +461,7 @@ foreach my $biblioNum (@biblionumbers) { my @notforloan_avs = Koha::AuthorisedValues->search_by_koha_field({ kohafield => 'items.notforloan', frameworkcode => $frameworkcode }); my $notforloan_label_of = { map { $_->authorised_value => $_->opac_description } @notforloan_avs }; - my $visible_items = { map { $_->itemnumber => $_ } $biblio->items->filter_by_visible_in_opac( { patron => $patron } )->as_list }; + my $visible_items = { map { $_->itemnumber => $_ } $biblio->items->filter_by_visible_in_opac( { patron => $patron } ) }; # Only keep the items that are visible in the opac (i.e. those in %visible_items) # FIXME: We should get rid of itemInfos altogether and use $visible_items -- 2.20.1