[Koha-patches] [PATCH] Bug 12279: Diacritics in system preference editor broken

Tomas Cohen Arazi tomascohen at gmail.com
Tue May 20 19:34:04 CEST 2014


This patch changes how .pref files are read. Instead of going through
all our global ultra-tweaked template object, we only use gettemplate
to build the correct file name (path included) and load it using the
(at functional) YAML::Syck::LoadFile method.

Pros: Doesn't break anything for YAML::Syck pre-1.27 (the ones shipped with
      Ubuntu 14.04)
Cons: something is wrong with C4::Templates encoding/decoding, or at least
      our default setup using C4::Templates->new doesn't work properly for
      all file types.

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
---
 admin/preferences.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/admin/preferences.pl b/admin/preferences.pl
index 8bcdb0a..b885e3e 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::LoadFile( $tab_template->{filename} );
 }
 
 sub _get_chunk {
-- 
1.9.1



More information about the Koha-patches mailing list