Bugzilla – Attachment 148628 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: (QA follow-up) Use $metadata->schema
Bug-32336-QA-follow-up-Use-metadata-schema.patch (text/plain), 2.55 KB, created by
Tomás Cohen Arazi
on 2023-03-23 23:18:48 UTC
(
hide
)
Description:
Bug 32336: (QA follow-up) Use $metadata->schema
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi
Created:
2023-03-23 23:18:48 UTC
Size:
2.55 KB
patch
obsolete
>From a8f040a57439dfcf9f5b960b7ae479d43e9fc6cd Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 23 Mar 2023 20:16:37 -0300 >Subject: [PATCH] Bug 32336: (QA follow-up) Use $metadata->schema > >When we worked on Koha::Biblio::Metadata, we agreed >biblio_metadata.schema would be the sourceof truth when it comes to the >record schema. > >This patch acknowledges that, while retaining the fallback to the >syspref. > >To test: >1. Apply this patch >2. Run: > $ prove t/db_dependent/api/v1/biblios.t >=> SUCCESS: Tests pass, behavior is unchanged. >3. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Biblios.pm | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 530df09be7b..baf9d943be7 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -67,14 +67,15 @@ sub get { > ); > } > else { >- my $record = $biblio->metadata->record; >- my $marcflavour = C4::Context->preference("marcflavour"); >+ my $metadata = $biblio->metadata; >+ my $record = $metadata->record; >+ my $schema = $metadata->schema // C4::Context->preference("marcflavour"); > > $c->respond_to( > marcxml => { > status => 200, > format => 'marcxml', >- text => $record->as_xml_record($marcflavour), >+ text => $record->as_xml_record($schema), > }, > mij => { > status => 200, >@@ -169,7 +170,8 @@ sub get_public { > > return try { > >- my $record = $biblio->metadata->record; >+ my $metadata = $biblio->metadata; >+ my $record = $metadata->record; > > my $opachiddenitems_rules = C4::Context->yaml_preference('OpacHiddenItems'); > my $patron = $c->stash('koha.user'); >@@ -189,7 +191,7 @@ sub get_public { > } > } > >- my $marcflavour = C4::Context->preference("marcflavour"); >+ my $schema = $metadata->schema // C4::Context->preference("marcflavour"); > > my $record_processor = Koha::RecordProcessor->new({ > filters => 'ViewPolicy', >@@ -205,7 +207,7 @@ sub get_public { > marcxml => { > status => 200, > format => 'marcxml', >- text => $record->as_xml_record($marcflavour), >+ text => $record->as_xml_record($schema), > }, > mij => { > status => 200, >-- >2.40.0
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