Bugzilla – Attachment 4839 Details for
Bug 5639
ILS-DI fixes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch (passed QA)
0001-Bug-5639-MT-3605-Fix-escaping-in-ILSDI.patch (text/plain), 6.61 KB, created by
Paul Poulain
on 2011-08-04 12:28:52 UTC
(
hide
)
Description:
proposed patch (passed QA)
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2011-08-04 12:28:52 UTC
Size:
6.61 KB
patch
obsolete
>From fd83ea67232f107c04bae9bf0f8bdafbd594c1b9 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= <jeanandre.santoni@biblibre.com> >Date: Wed, 26 May 2010 15:49:34 +0200 >Subject: [PATCH] Bug 5639 (MT #3605) Fix escaping in ILSDI > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> >--- > C4/ILSDI/Services.pm | 15 ++------ > koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt | 44 +++++++++++++------------- > opac/ilsdi.pl | 1 - > 3 files changed, 26 insertions(+), 34 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index ba0c429..90f741a 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -193,15 +193,12 @@ sub GetRecords { > # Get the biblioitem from the biblionumber > my $biblioitem = ( GetBiblioItemByBiblioNumber( $biblionumber, undef ) )[0]; > if ( not $biblioitem->{'biblionumber'} ) { >- $biblioitem = "RecordNotFound"; >+ $biblioitem->{code} = "RecordNotFound"; > } > > # We don't want MARC to be displayed > delete $biblioitem->{'marc'}; > >- # nor the XML declaration of MARCXML >- $biblioitem->{'marcxml'} =~ s/<\?xml version="1.0" encoding="UTF-8"\?>//go; >- > # Get most of the needed data > my $biblioitemnumber = $biblioitem->{'biblioitemnumber'}; > my @reserves = GetReservesFromBiblionumber( $biblionumber, undef, undef ); >@@ -224,8 +221,6 @@ sub GetRecords { > $biblioitem->{'reserves'}->{'reserve'} = $reserves[1]; > $biblioitem->{'issues'}->{'issue'} = $issues; > >- map { $biblioitem->{$_} = encode_entities( $biblioitem->{$_}, '&' ) } grep( !/marcxml/, keys %$biblioitem ); >- > push @records, $biblioitem; > } > >@@ -256,18 +251,16 @@ sub GetAuthorityRecords { > return { code => 'UnsupportedSchema' }; > } > >- my $records; >+ my @records; > > # Let's loop over the authority IDs > foreach my $authid ( split( / /, $cgi->param('id') ) ) { > > # Get the record as XML string, or error code >- my $record = GetAuthorityXML($authid) || "<record><code>RecordNotFound</code></record>"; >- $record =~ s/<\?xml(.*)\?>//go; >- $records .= $record; >+ push @records, GetAuthorityXML($authid) || { code => 'RecordNotFound' }; > } > >- return $records; >+ return { record => \@records }; > } > > =head2 LookupPatron >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt b/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt >index 765febc..acd1258 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/ilsdi.tt >@@ -120,6 +120,7 @@ > <biblioitemnumber>1</biblioitemnumber> > <isbn>9782862749198</isbn> > <marcxml> >+ <?xml version="1.0" encoding="UTF-8" ?> > <record > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd" >@@ -208,6 +209,7 @@ > <biblioitemnumber>2</biblioitemnumber> > <isbn>9782265078031</isbn> > <marcxml> >+ <?xml version="1.0" encoding="UTF-8" ?> > <record > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd" >@@ -316,41 +318,39 @@ > ilsdi.pl?service=GetAuthorityRecords&id=1+2+99999 > </a> > <h4>Example Response</h4> >-<pre><?xml version="1.0" encoding="ISO-8859-1" ?> >+<pre><xml version="1.0" encoding="UTF-8">; > <GetAuthorityRecords> >+ <record> >+ <?xml version="1.0" encoding="UTF-8"?> > <record > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd" > xmlns="http://www.loc.gov/MARC21/slim"> >- <leader>00126nx j2200073 4500 </leader> >+ <leader>00182 2200085 4500</leader> > <controlfield tag="001">1</controlfield> >- <datafield tag="250" ind1=" " ind2=" "> >- <subfield code="a">TECHNIQUE</subfield> >+ <datafield tag="200" ind1=" " ind2=" "> >+ <subfield code="a">Hugo</subfield> >+ <subfield code="b">Victor</subfield> > </datafield> >- <datafield tag="100" ind1=" " ind2=" "> >- <subfield code="a">20071210afrey50 ba0</subfield> >- </datafield> >- <datafield tag="152" ind1=" " ind2=" "> >- <subfield code="b">NC</subfield> >- </datafield> >- </record> >- <record >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://www.loc.gov/MARC21/slim http://www.loc.gov/ standards/marcxml/schema/MARC21slim.xsd" >- xmlns="http://www.loc.gov/MARC21/slim"> >- <leader>00130nx j2200073 4500 </leader> >- <controlfield tag="001">2</controlfield> >- <datafield tag="250" ind1=" " ind2=" "> >- <subfield code="a">CHEMIN DE FER</subfield> >+ <datafield tag="801" ind1=" " ind2=" "> >+ <subfield code="a">France</subfield> >+ <subfield code="b">Nimes</subfield> >+ <subfield code="c">2010/04/13</subfield> > </datafield> > <datafield tag="100" ind1=" " ind2=" "> >- <subfield code="a">20071210afrey50 ba0</subfield> >+ <subfield code="a">20100413 50 </subfield> > </datafield> > <datafield tag="152" ind1=" " ind2=" "> >- <subfield code="b">NC</subfield> >+ <subfield code="b">NP</subfield> > </datafield> > </record> >- <record>RecordNotFound</record> >+ </record> >+ <record> >+ <code>RecordNotFound</code> >+ </record> >+ <record> >+ <code>RecordNotFound</code> >+ </record> > </GetAuthorityRecords></pre> > > [% ELSIF ( LookupPatron ) %] >diff --git a/opac/ilsdi.pl b/opac/ilsdi.pl >index 56058f0..48fd7ba 100755 >--- a/opac/ilsdi.pl >+++ b/opac/ilsdi.pl >@@ -233,7 +233,6 @@ print CGI::header('-type'=>'text/xml', '-charset'=>'utf-8'); > print XMLout( > $out, > noattr => 1, >- noescape => 1, > nosort => 1, > xmldecl => '<?xml version="1.0" encoding="UTF-8" ?>', > RootName => $service, >-- >1.7.4.1 >
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 5639
:
3584
|
4088
| 4839