From 1c834f18d59c9334e6b9480b525692cbdb5ea666 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 26 Aug 2021 09:06:50 -0300 Subject: [PATCH] Bug 26223: (QA follow-up) Fix filter order Signed-off-by: Tomas Cohen Arazi Signed-off-by: Jonathan Druart --- opac/opac-ISBDdetail.pl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index f43475ddfe..47fcb5e852 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -98,18 +98,18 @@ unless ( $patron and $patron->category->override_hidden_items ) { } } -my $record = $biblio->metadata->record; -my @items = grep { !$_->hidden_in_opac({ rules => $opachiddenitems_rules }) } @{$biblio->items->as_list} ; -my $marcflavour = C4::Context->preference("marcflavour"); - -my $record_processor = Koha::RecordProcessor->new({ - filters => [ 'ViewPolicy', 'EmbedItems' ], - options => { - interface => 'opac', - frameworkcode => $biblio->frameworkcode, - items => \@items +my $record = $biblio->metadata->record; +my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron })->as_list; + +my $record_processor = Koha::RecordProcessor->new( + { filters => [ 'EmbedItems', 'ViewPolicy' ], + options => { + interface => 'opac', + frameworkcode => $biblio->frameworkcode, + items => \@items + } } -}); +); $record_processor->process($record); # get biblionumbers stored in the cart @@ -120,6 +120,7 @@ if(my $cart_list = $query->cookie("bib_list")){ } } +my $marcflavour = C4::Context->preference("marcflavour"); # some useful variables for enhanced content; # in each case, we're grabbing the first value we find in # the record and normalizing it -- 2.39.5