Bugzilla – Attachment 105481 Details for
Bug 17842
Broken diacritics on records exported as MARC from cart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17842: Simplify the code
Bug-17842-Simplify-the-code.patch (text/plain), 2.54 KB, created by
Jonathan Druart
on 2020-06-02 09:06:03 UTC
(
hide
)
Description:
Bug 17842: Simplify the code
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-06-02 09:06:03 UTC
Size:
2.54 KB
patch
obsolete
>From 474ce5d457096dc6eca3b6f72add32bc684911d6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 2 Jun 2020 11:05:12 +0200 >Subject: [PATCH] Bug 17842: Simplify the code > >There is no need for all the conditions. >From Encode::encode POD: > "If the $string is undef, then undef is returned." >--- > basket/downloadcart.pl | 13 +++---------- > opac/opac-downloadcart.pl | 12 +++--------- > 2 files changed, 6 insertions(+), 19 deletions(-) > >diff --git a/basket/downloadcart.pl b/basket/downloadcart.pl >index b69c7e2bba..487e9c626a 100755 >--- a/basket/downloadcart.pl >+++ b/basket/downloadcart.pl >@@ -71,16 +71,9 @@ if ($bib_list && $format) { > next unless $record; > > if ($format eq 'iso2709') { >- my $usmarc = $record->as_usmarc(); >- if ($usmarc){ >- #NOTE: If we don't explicitly UTF-8 encode the output, >- #the browser will guess the encoding, and it won't always choose UTF-8. >- my $bytes = encode("UTF-8", $usmarc); >- if ($bytes) { >- $output .= $bytes; >- } >- >- } >+ #NOTE: If we don't explicitly UTF-8 encode the output, >+ #the browser will guess the encoding, and it won't always choose UTF-8. >+ $output .= encode("UTF-8", $record->as_usmarc()) // q{}; > } > elsif ($format eq 'ris') { > $output .= marc2ris($record); >diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl >index f08dea13f1..35214ea0e9 100755 >--- a/opac/opac-downloadcart.pl >+++ b/opac/opac-downloadcart.pl >@@ -90,15 +90,9 @@ if ($bib_list && $format) { > next unless $record; > > if ($format eq 'iso2709') { >- my $usmarc = $record->as_usmarc(); >- if ($usmarc) { >- #NOTE: If we don't explicitly UTF-8 encode the output, >- #the browser will guess the encoding, and it won't always choose UTF-8. >- my $bytes = encode("UTF-8", $usmarc); >- if ($bytes) { >- $output .= $bytes; >- } >- } >+ #NOTE: If we don't explicitly UTF-8 encode the output, >+ #the browser will guess the encoding, and it won't always choose UTF-8. >+ $output .= encode("UTF-8", $record->as_usmarc()) // q{}; > } > elsif ($format eq 'ris') { > $output .= marc2ris($record); >-- >2.20.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 17842
:
105333
|
105341
|
105344
|
105345
|
105346
|
105440
|
105481
|
105568
|
105569