Bugzilla – Attachment 28424 Details for
Bug 12279
Diacritics in system preference editor broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12279: Diacritics in system preference editor broken
Bug-12279-Diacritics-in-system-preference-editor-b.patch (text/plain), 2.13 KB, created by
Tomás Cohen Arazi (tcohen)
on 2014-05-22 11:56:35 UTC
(
hide
)
Description:
Bug 12279: Diacritics in system preference editor broken
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2014-05-22 11:56:35 UTC
Size:
2.13 KB
patch
obsolete
>From 0a9f236894ce341a4c43cc9b5d9a435453c26b3a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Thu, 22 May 2014 08:47:45 -0300 >Subject: [PATCH] Bug 12279: Diacritics in system preference editor broken > >This patch changes how .pref files are read. Instead of going through >all our global ultra-tweaked C4::Templates->output method, it adds a new >one that takes care of decoding the .pref file data for storing in memory. > >This might need to be re-done in the context of 11944, but at least provides >a clean workaround for 3.16. > >To test: >- On clean master, install a translation like: > cd misc/translator ; perl translate install fr-FR >- Go to sysprefs, opac >=> FAIL: descriptions are encoding-broken >- Apply the patch, reload >=> SUCCESS: Everything shows ok > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba >--- > C4/Templates.pm | 16 ++++++++++++++++ > admin/preferences.pl | 2 +- > 2 files changed, 17 insertions(+), 1 deletion(-) > >diff --git a/C4/Templates.pm b/C4/Templates.pm >index 8d13a49..7093cce 100644 >--- a/C4/Templates.pm >+++ b/C4/Templates.pm >@@ -5,6 +5,7 @@ use warnings; > use Carp; > use CGI; > use List::MoreUtils qw/any/; >+use Encode qw/decode/; > > # Copyright 2009 Chris Cormack and The Koha Dev Team > # >@@ -134,6 +135,21 @@ sub output { > return $data; > } > >+sub output_prefs { >+ >+ my $self = shift; >+ my $vars = shift; >+ >+ my $template = $self->{ TEMPLATE }; >+ my $data; >+ >+ $template->process( $self->filename, >+ $vars, \$data ) >+ || die "Template process failed: ", $template->error(); >+ >+ return decode('UTF-8',$data); >+} >+ > sub utf8_arrayref { > my $arrayref = shift; > foreach my $element (@$arrayref){ >diff --git a/admin/preferences.pl b/admin/preferences.pl >index 8bcdb0a..3336045 100755 >--- a/admin/preferences.pl >+++ b/admin/preferences.pl >@@ -54,7 +54,7 @@ sub GetTab { > local_currency => $local_currency, # currency code is used, because we do not know how a given currency is formatted. > ); > >- return YAML::Syck::Load( $tab_template->output() ); >+ return YAML::Syck::Load( $tab_template->output_prefs() ); > } > > sub _get_chunk { >-- >1.9.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 12279
:
28316
|
28317
|
28318
|
28375
|
28377
|
28378
|
28380
|
28424
|
28438
|
28517
|
28557
|
28614