Bugzilla – Attachment 15111 Details for
Bug 9425
Template plugins are missing utf8 encoding
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9425: Template plugins are missing utf8 encoding
SIGNED-OFF-Bug-9425-Template-plugins-are-missing-u.patch (text/plain), 2.84 KB, created by
Owen Leonard
on 2013-02-06 16:12:48 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9425: Template plugins are missing utf8 encoding
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-02-06 16:12:48 UTC
Size:
2.84 KB
patch
obsolete
>From fbbe14825a72ccb879cd6c7789906264a4fe1db4 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Fri, 18 Jan 2013 15:50:53 +0100 >Subject: [PATCH] [SIGNED-OFF] Bug 9425: Template plugins are missing utf8 > encoding >Content-Type: text/plain; charset="utf-8" > >Koha custom template plugins KohaAuthorisedValues and KohaBranchName are >missing UTF-8 encoding. When they render a value with diacritical >characters, those characters are replaced by a <?> sign. > >Test plan : > >For KohaAuthorisedValues : >- Edit a value of LOST authorized values to have a description with a > diacritical character >- Edit a biblio to have an item using this authorized value in > items.itemlost >- Go to OPAC detail page of this biblio => Lost description must be > correctly encoded > >For KohaBranchName : >- Choose a serial subscription >- Edit its branch to has a diacritical character in name >- Go to subscription details : serials/subscription-detail.pl >=> Library name must be correctly encoded > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >I was finally able to reproduce the problem in the OPAC, but still not >in the staff client. However, since it's obvious the patch corrects >problems in some situations and doesn't seem to have an adverse effect >I'm signing off. >--- > Koha/Template/Plugin/KohaAuthorisedValues.pm | 4 +++- > Koha/Template/Plugin/KohaBranchName.pm | 6 ++++-- > 2 files changed, 7 insertions(+), 3 deletions(-) > >diff --git a/Koha/Template/Plugin/KohaAuthorisedValues.pm b/Koha/Template/Plugin/KohaAuthorisedValues.pm >index 68b1347..85c1421 100644 >--- a/Koha/Template/Plugin/KohaAuthorisedValues.pm >+++ b/Koha/Template/Plugin/KohaAuthorisedValues.pm >@@ -19,6 +19,7 @@ package Koha::Template::Plugin::KohaAuthorisedValues; > > use Modern::Perl; > >+use Encode; > use Template::Plugin; > use base qw( Template::Plugin ); > >@@ -44,7 +45,8 @@ will print the OPAC description for the LOST value stored in item.itemlost. > > sub GetByCode { > my ( $self, $category, $code, $opac ) = @_; >- return GetAuthorisedValueByCode( $category, $code, $opac ); >+ my $lib = GetAuthorisedValueByCode( $category, $code, $opac ); >+ return Encode::encode_utf8($lib); > } > > 1; >diff --git a/Koha/Template/Plugin/KohaBranchName.pm b/Koha/Template/Plugin/KohaBranchName.pm >index a39aba0..81d0184 100644 >--- a/Koha/Template/Plugin/KohaBranchName.pm >+++ b/Koha/Template/Plugin/KohaBranchName.pm >@@ -20,16 +20,18 @@ package Koha::Template::Plugin::KohaBranchName; > use strict; > use warnings; > >+use Encode; > use Template::Plugin::Filter; > use base qw( Template::Plugin::Filter ); > use warnings; > use strict; > >-use C4::Branch qw( GetBranchName );; >+use C4::Branch qw( GetBranchName ); > > sub filter { > my ($self,$branchcode) = @_; >- return GetBranchName( $branchcode ); >+ my $branchname = GetBranchName( $branchcode ); >+ return Encode::encode_utf8($branchname); > } > > 1; >-- >1.7.9.5
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 9425
:
14697
| 15111