From 47c01f0b8a181a2d6f31478d08d9a3ee728e7fe4 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 23 Dec 2021 08:41:33 -0300 Subject: [PATCH] Bug 29764: Fix incorrect EmbedItems RecordProcessor filter POD This patch makes the usage POD for the EmbedItems filter actually be usable. The filter is used in opac-ISBDdetail.pl and the POD is updated to how it is used there. Not much to test. Signed-off-by: David Cook Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- Koha/Filter/MARC/EmbedItems.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Koha/Filter/MARC/EmbedItems.pm b/Koha/Filter/MARC/EmbedItems.pm index ae8ec34a26..2839694ff8 100644 --- a/Koha/Filter/MARC/EmbedItems.pm +++ b/Koha/Filter/MARC/EmbedItems.pm @@ -28,21 +28,22 @@ my $biblio = Koha::Biblios->find( { prefetch => [ items, metadata ] } ); -my $rules = C4::Context->yaml_preference('OpacHiddenItems'); +my $patron = Koha::Patrons->find($loggedinuser); -my @items = grep { !$_->hidden_in_opac({ rules => $rules }) @{$biblio->items}; my $record = $biblio->metadata->record; +my @items = $biblio->items->filter_by_visible_in_opac({ patron => $patron })->as_list; -my $processor = Koha::RecordProcessor->new( +my $record_processor = Koha::RecordProcessor->new( { - filters => ('EmbedItems'), + filters => ['EmbedItems'], options => { - items => \@items + interface => 'opac', + items => \@items } } ); -$processor->process( $record ); +$record_processor->process($record); =head1 DESCRIPTION -- 2.39.5