From 159f06d635b681edda1660c4e2aeecf7356f613b Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 30 Mar 2020 19:02:04 -0300 Subject: [PATCH] Bug 23247: (QA follow-up) Restore embedding items in record The original code called GetMarcBiblio with embeditems => 1, and I overlooked it. This patch makes it embed the items. Signed-off-by: Tomas Cohen Arazi --- opac/opac-MARCdetail.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index c4c300181a..c16da0bb15 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -107,11 +107,19 @@ unless ( $patron and $patron->category->override_hidden_items ) { my $record = $biblio->metadata->record; my $marcflavour = C4::Context->preference("marcflavour"); +my @visible_items = $biblio->items->as_list; +@visible_items = + grep { !$_->hidden_in_opac( { rules => $opachiddenitems_rules } ) } + @visible_items + unless $patron and $patron->category->override_hidden_items; + + my $record_processor = Koha::RecordProcessor->new({ - filters => 'ViewPolicy', + filters => [ 'EmbedItems', 'ViewPolicy' ], options => { - interface => 'opac', - frameworkcode => $biblio->frameworkcode + interface => 'opac', + frameworkcode => $biblio->frameworkcode, + items => \@visible_items } }); $record_processor->process($record); @@ -305,7 +313,7 @@ foreach my $field (@fields) { } else { $item->{ $subf[$i][0] } .= GetAuthorisedValueDesc( $field->tag(), $subf[$i][0], - $subf[$i][1], '', $tagslib, '', 'opac' ); + $subf[$i][1], '', $tagslib, '', 'opac' ) // ""; } my $kohafield = $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{kohafield}; -- 2.26.0