Bugzilla – Attachment 3301 Details for
Bug 3326
xml entity refs display incorrectly in results page if exported and indexed as xml
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
bug3366.patch (text/plain), 3.18 KB, created by
Nicole C. Engard
on 2011-03-15 12:38:12 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nicole C. Engard
Created:
2011-03-15 12:38:12 UTC
Size:
3.18 KB
patch
obsolete
>From: Jared Camins-Esakov <jcamins@bywatersolutions.com> >To: dev@bywatersolutions.com >Cc: Jared Camins-Esakov <jcamins@bywatersolutions.com> >Subject: [PATCH] Bug 3326: Work around Zebra's handling of & entities >Date: Mon, 14 Mar 2011 12:23:33 -0400 >Message-Id: <1300119813-2109-1-git-send-email-jcamins@bywatersolutions.com> >X-Mailer: git-send-email 1.7.2.3 >X-Original-Sender: jcamins@bywatersolutions.com >X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: > 209.85.216.170 is neither permitted nor denied by best guess record for > domain of jcamins@bywatersolutions.com) smtp.mail=jcamins@bywatersolutions.com >Precedence: list >Mailing-list: list dev@bywatersolutions.com; contact dev+owners@bywatersolutions.com >List-ID: <dev.bywatersolutions.com> >X-Google-Group-Id: 274270250429 >List-Help: <http://www.google.com/support/a/bywatersolutions.com/bin/static.py?hl=en_US&page=groups.cs>, > <mailto:dev+help@bywatersolutions.com> >Content-Type: text/plain; charset="utf-8" > >When using XSLT mode, the OPAC results display will show "&" instead of "&" >when Zebra is indexing in XML mode. This patch works around this by replacing >"&" with "&" and then extends the previous fix to apply to all occurrences >of "& " instead of just the first. >--- > C4/Search.pm | 4 +++- > C4/XSLT.pm | 7 +++++-- > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 26dc67f..c486df9 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1687,7 +1687,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 348930f..d602688 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); >@@ -139,8 +139,11 @@ sub XSLTParse4Display { > } > $sysxml .= "</sysprefs>\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 >-- >1.7.2.3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3326
: 3301 |
3322
|
3323
|
3463