Bugzilla – Attachment 144207 Details for
Bug 32336
MARCXML output of REST API may be badly encoded (UNIMARC)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32336: Fix encoding of MARCXML output for REST API (UNIMARC)
Bug-32336-Fix-encoding-of-MARCXML-output-for-REST-.patch (text/plain), 2.09 KB, created by
Julian Maurice
on 2022-11-23 15:14:26 UTC
(
hide
)
Description:
Bug 32336: Fix encoding of MARCXML output for REST API (UNIMARC)
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2022-11-23 15:14:26 UTC
Size:
2.09 KB
patch
obsolete
>From 3868bbbf8f4ac3d0621b2d03b8c32fb031dadb89 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 23 Nov 2022 15:43:06 +0100 >Subject: [PATCH] Bug 32336: Fix encoding of MARCXML output for REST API > (UNIMARC) > >Test plan: >1. Be sure to test on a UNIMARC instance >2. Enable system preferences RESTPublicAPI and RESTPublicAnonymousRequests >3. Create a biblio with some diacritics >4. Restart koha and do not interact with OPAC or the staff interface > (this may change $MARC::File::XML::RecordFormat) >5. Query the public API to retrieve the created biblio in MARCXML. For > instance with cURL: > > curl -H 'Accept: application/marcxml+xml' \ > http://koha.local/api/v1/public/biblios/<biblionumber> > > You should see encoding issues. >6. Apply the patch and restart Koha. >7. Repeat step 5. > You should see no encoding issues. >8. You should also test /api/v1/biblios/<biblionumber> (this one > requires authentication, so cURL might not be the most practical > tool; use your favorite tool for this) >--- > Koha/REST/V1/Biblios.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index f923255cfa..d6bad500b4 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -67,12 +67,13 @@ sub get { > } > else { > my $record = $biblio->metadata->record; >+ my $marcflavour = C4::Context->preference("marcflavour"); > > $c->respond_to( > marcxml => { > status => 200, > format => 'marcxml', >- text => $record->as_xml_record >+ text => $record->as_xml_record($marcflavour), > }, > mij => { > status => 200, >@@ -203,7 +204,7 @@ sub get_public { > marcxml => { > status => 200, > format => 'marcxml', >- text => $record->as_xml_record >+ text => $record->as_xml_record($marcflavour), > }, > mij => { > status => 200, >-- >2.30.2
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 32336
:
144207
|
146846
|
146847
|
148614
|
148615
|
148628