View | Details | Raw Unified | Return to bug 29764
Collapse All | Expand All

(-)a/Koha/Filter/MARC/EmbedItems.pm (-7 / +7 lines)
Lines 28-48 my $biblio = Koha::Biblios->find( Link Here
28
    { prefetch => [ items, metadata ] }
28
    { prefetch => [ items, metadata ] }
29
);
29
);
30
30
31
my $rules = C4::Context->yaml_preference('OpacHiddenItems');
31
my $patron = Koha::Patrons->find($loggedinuser);
32
32
33
my @items  = grep { !$_->hidden_in_opac({ rules => $rules }) @{$biblio->items};
34
my $record = $biblio->metadata->record;
33
my $record = $biblio->metadata->record;
34
my @items  = $biblio->items->filter_by_visible_in_opac({ patron => $patron })->as_list;
35
35
36
my $processor = Koha::RecordProcessor->new(
36
my $record_processor = Koha::RecordProcessor->new(
37
    {
37
    {
38
        filters => ('EmbedItems'),
38
        filters => ['EmbedItems'],
39
        options => {
39
        options => {
40
            items        => \@items
40
            interface => 'opac',
41
            items     => \@items
41
        }
42
        }
42
    }
43
    }
43
);
44
);
44
45
45
$processor->process( $record );
46
$record_processor->process($record);
46
47
47
=head1 DESCRIPTION
48
=head1 DESCRIPTION
48
49
49
- 

Return to bug 29764