From 2d0f7b2fe7ca5e444b590a60ca37ef2c82b214b5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 20 Jan 2016 12:40:22 +0000 Subject: [PATCH] Bug 14377 [QA Followup] - Don't do 942$n processing for UNIMARC --- C4/XSLT.pm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 2b83279..30af940 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -160,6 +160,7 @@ sub _get_best_default_xslt_filename { sub XSLTParse4Display { my ( $biblionumber, $orig_record, $xslsyspref, $fixamps, $hidden_items ) = @_; my $xslfilename = C4::Context->preference($xslsyspref); + my $marcflavour = C4::Context->preference('marcflavour'); if ( $xslfilename =~ /^\s*"?default"?\s*$/i ) { my $htdocs; my $theme; @@ -197,7 +198,7 @@ sub XSLTParse4Display { # grab the XML, run it through our stylesheet, push it out to the browser my $record = transformMARCXML4XSLT($biblionumber, $orig_record); my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); - my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); + my $xmlrecord = $record->as_xml($marcflavour); my $sysxml = "\n"; foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD @@ -224,16 +225,18 @@ sub XSLTParse4Display { ## Non-syspref variables that need to be computed $sysxml .= ""; - # Fetch the authorised value description for 942$n ( supressed in opac ) for the value '1' - # if 942$n is not mapped, the return value will be '1' which means even if the field is not - # mapped in the framework, we will still get the correct value to compare against - my $frameworkcode = GetFrameworkCode($biblionumber) || ''; - my $tagslib = &GetMarcStructure(1,$frameworkcode); - my $value = GetAuthorisedValueDesc( '942', 'n', '1', '', $tagslib ); - $sysxml .= "$value"; - - $sysxml .= "\n"; - ## End non-syspref variables that need to be computed + unless ( $marcflavour eq 'UNIMARC' ) { + # Fetch the authorised value description for 942$n ( supressed in opac ) for the value '1' + # if 942$n is not mapped, the return value will be '1' which means even if the field is not + # mapped in the framework, we will still get the correct value to compare against + my $frameworkcode = GetFrameworkCode($biblionumber) || ''; + my $tagslib = &GetMarcStructure(1,$frameworkcode); + my $value = GetAuthorisedValueDesc( '942', 'n', '1', '', $tagslib ); + $sysxml .= "$value"; + + $sysxml .= "\n"; + ## End non-syspref variables that need to be computed + } $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/; if ($fixamps) { # We need to correct the HTML entities that Zebra outputs -- 2.7.0