diff --git a/C4/Search.pm b/C4/Search.pm index dd76f4f90f..e8e0124ca5 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1685,7 +1685,9 @@ sub searchResults { # FIXME note that XSLTResultsDisplay (use of XSLT to format staff interface bib search results) # is not implemented yet $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, 'Results', - $search_context); + $search_context, 1); + # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs + } # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 4b6a99c3fa..e63ecaf503 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -120,7 +120,7 @@ sub getAuthorisedValues4MARCSubfields { my $stylesheet; sub XSLTParse4Display { - my ( $biblionumber, $orig_record, $xsl_suffix, $interface ) = @_; + my ( $biblionumber, $orig_record, $xsl_suffix, $interface, $fixamps ) = @_; $interface = 'opac' unless $interface; # grab the XML, run it through our stylesheet, push it out to the browser my $record = transformMARCXML4XSLT($biblionumber, $orig_record); @@ -138,8 +138,11 @@ sub XSLTParse4Display { } $sysxml .= "\n"; $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/; + if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs + $xmlrecord =~ s/\&/\&/g; + } $xmlrecord =~ s/\& /\&\; /; - $xmlrecord=~ s/\&\;amp\; /\&\; /; + $xmlrecord =~ s/\&\;amp\; /\&\; /; my $parser = XML::LibXML->new(); # don't die when you find &, >, etc