From 8558d9f38fe04950bbd9d3b25e8b1de8f395a97b 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 --- 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 47fcb5e852..41119b3521 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 721981bb2a..11682d76ff 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.30.2