From 6653aeaf14652bf856275a43084ec5f4dd991b63 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 Signed-off-by: Kyle M Hall --- 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 35722a39b2..c20b1e3a60 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -90,18 +90,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 @@ -112,6 +112,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