Bugzilla – Attachment 154351 Details for
Bug 34514
opac-showmarc.pl does not handle UNIMARC well
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34514: opac-showmarc.pl use marc flavour
Bug-34514-opac-showmarcpl-use-marc-flavour.patch (text/plain), 1.70 KB, created by
Fridolin Somers
on 2023-08-10 19:01:10 UTC
(
hide
)
Description:
Bug 34514: opac-showmarc.pl use marc flavour
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-08-10 19:01:10 UTC
Size:
1.70 KB
patch
obsolete
>From f66fffe454e78a2c2910bea382c15fe7df8ff01a Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 10 Aug 2023 08:50:44 -1000 >Subject: [PATCH] Bug 34514: opac-showmarc.pl use marc flavour >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >opac-showmarc.pl calls $record->as_xml. >We see in other places using XSL transformation that MARC flavor should be sent. > >Looks like encoding fails when a "real" UTF-8 character is used. For example uppercase é > >Bug 29333 fixed catalogue/showmarc.pl. > >Test plan : >1) Use UNIMARC database >2) Edit a biblio record to add uppercase é in title 200$a >3) Go to OPAC MARC vue of this record >4) Download record as MARCXML >=> Check encoding of title is OK >5) Click on 'view plain' >=> Check encoding of title is OK >--- > opac/opac-showmarc.pl | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl >index 57c63fede1..b19f861824 100755 >--- a/opac/opac-showmarc.pl >+++ b/opac/opac-showmarc.pl >@@ -56,6 +56,8 @@ unless ( $biblio ) { > } > > my $view= $input->param('viewas') || 'marc'; >+my $marcflavour = C4::Context->preference('marcflavour'); >+my $format = $marcflavour eq 'UNIMARC' ? 'UNIMARC' : 'USMARC'; > > my $record_processor = Koha::RecordProcessor->new( > { >@@ -77,7 +79,7 @@ if(!ref $record) { > $record_processor->process($record); > > if ($view eq 'card' || $view eq 'html') { >- my $xml = $record->as_xml; >+ my $xml = $record->as_xml($format); > my $xsl = $view eq 'card' ? 'compact.xsl' : 'plainMARC.xsl'; > my $htdocs = C4::Context->config('opachtdocs'); > my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'opac', $input); >-- >2.41.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 34514
:
154350
| 154351