From 8855087b8f248b768ad3c9b4bfe9095d0b33ccb2 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Wed, 21 Jul 2021 17:01:23 +1200 Subject: [PATCH] Bug 28734: Parse display in $biblio->get_marc_notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Go to Koha Administration, MARC bibliographic frameworks 2. Edit a framework, find tag 590, edit the $z subfield to use an authorised value. 3. Do a catalogue search and edit a record using this framework. Edit 590$z and select an authorised value. Save the record. 4. Add the record to your cart. 5. View your cart. Click More Details. 6. Scroll down to the Notes section. Notice the authorised value code is displayed instead of the description. 7. Apply the patch, restart services. 8. Refresh your cart. Click More Details again if you need to. 9. Scroll down to the Notes section. The description of the authorised value should now be displayed. Sponsored-by: Catalyst IT Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: David Nind Signed-off-by: Joonas Kylmälä --- Koha/Biblio.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 26ee7abd96..d80e3f0406 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -24,6 +24,7 @@ use URI; use URI::Escape qw( uri_escape_utf8 ); use C4::Koha qw( GetNormalizedISBN ); +use C4::XSLT qw( XSLTParse4Display ); use Koha::Database; use Koha::DateUtils qw( dt_from_string ); @@ -829,7 +830,14 @@ sub get_marc_notes { my %hiddenlist = map { $_ => 1 } split( /,/, C4::Context->preference('NotesToHide')); - foreach my $field ( $self->metadata->record->field($scope) ) { + my $record = $self->metadata->record; + + my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || 'default'; + my $lang = $xslfile ? C4::Languages::getlanguage() : undef; + my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + XSLTParse4Display( $self->biblionumber, $record, "XSLTDetailsDisplay", 1, undef, $sysxml, $xslfile, $lang, undef ); + + foreach my $field ( $record->field($scope) ) { my $tag = $field->tag(); next if $hiddenlist{ $tag }; next if $opac && $maybe_private{$tag} && !$field->indicator(1); -- 2.20.1