---- Reported by rch@liblime.com 2009-06-13 20:20:21 ---- If rebuild_zebra.pl is used with the 'as xml' switch, the XSLT processing on opac-results.pl does not handle xml entity refs properly. Symptoms: A record may display like this in search results: Standard & Poor's research insight.Report & chart library (North America) by Standard & Poor's Compustat Services. yet display correctly in the details page. Steps to reproduce: * edit a record, adding an ampersand to the title. * rebuild zebra: without -x , the title displays properly in search results. * repeat, this time running rebuild_zebra.pl -x * the '&' now displays as '&' in opac-results only. opac-details is not affected. ---- Additional Comments From cmurdock@ccfls.org 2010-03-18 20:09:38 ---- This applies in the staff interface search results as well. In the page source, ampersands are written like this: &amp; ---- Additional Comments From cmurdock@ccfls.org 2010-03-18 21:03:15 ---- This fixes it in the OPAC. Emailed to patches list. diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 8dd7840..b99b994 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -136,6 +136,7 @@ sub XSLTParse4Display { $sysxml .= "</sysprefs>\n"; $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/; $xmlrecord =~ s/\& /\&\; /; + $xmlrecord=~ s/\&\;amp\; /\&\; /; my $parser = XML::LibXML->new(); # don't die when you find &, >, etc -- 1.5.6.5 ---- Additional Comments From cmurdock@ccfls.org 2010-04-19 18:46:04 ---- Just mailed a patch that fixes it for non-XSLT search results in the Intranet. ---- Additional Comments From gmcharlt@gmail.com 2010-04-22 10:23:03 ---- Pushed second patch from Cindy Ames. --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:09 UTC --- This bug was previously known as _bug_ 3326 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3326 Actual time not defined. Setting to 0.0 The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chris@bigballofwax.co.nz. Previous reporter was rch@liblime.com. CC member ariana.baker@gmail.com does not have an account here
This ultimately stems from a bug or misconfiguration in Zebra: when it converts from MARCXML to ISO2709 internally, it doesn't seem to be be converted & entities back to the '&' character. This has been observed in version 2.0.44 of Zebra.
Created attachment 3301 [details] [review] patch
Pushed and merged, please test and mark resolved
Follow up patch signed off and submitted.
Created attachment 3322 [details] [review] follow up patch
Created attachment 3323 [details] [review] Follow-up patch (reuploaded)
Followup patch works -- signing off
My initial patch was too aggressive in stripping out ampersand entities and broke the search results display for records with ampersands when -x was not used with rebuild_zebra.pl -b. The follow-up patch corrects this problem.
Pushed please test
This now works for me. If someone else could confirm and close, I'd be grateful.
There will be another follow-up patch. In some circumstances the display in the Staff client isn't fixed.
follow up patch for staff client signed off
Created attachment 3463 [details] [review] follow up patch 2
Pushed, please test