From 82146d010f730602a65baa69fabd7883a06b6647 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 17 Mar 2014 13:33:43 +0100 Subject: [PATCH] Bug 11944: TT Plugins should not encode strings --- Koha/Template/Plugin/AuthorisedValues.pm | 4 +--- Koha/Template/Plugin/Branches.pm | 3 +-- Koha/Template/Plugin/ItemTypes.pm | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Koha/Template/Plugin/AuthorisedValues.pm b/Koha/Template/Plugin/AuthorisedValues.pm index 0a19be2..156a83e 100644 --- a/Koha/Template/Plugin/AuthorisedValues.pm +++ b/Koha/Template/Plugin/AuthorisedValues.pm @@ -22,8 +22,6 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use Encode qw{encode decode}; - use C4::Koha; =pod @@ -40,7 +38,7 @@ The parameters are identical to those used by the subroutine C4::Koha::GetAuthor sub GetByCode { my ( $self, $category, $code, $opac ) = @_; - return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) ); + return GetAuthorisedValueByCode( $category, $code, $opac ); } 1; diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index ddf5f2f..4f1da48 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -21,7 +21,6 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use Encode qw{encode decode}; use C4::Koha; use C4::Context; @@ -33,7 +32,7 @@ sub GetName { my $sth = C4::Context->dbh->prepare($query); $sth->execute($branchcode); my $b = $sth->fetchrow_hashref(); - return $b ? encode( 'UTF-8', $b->{'branchname'} ) : q{}; + return $b ? $b->{'branchname'} : q{}; } sub GetLoggedInBranchcode { diff --git a/Koha/Template/Plugin/ItemTypes.pm b/Koha/Template/Plugin/ItemTypes.pm index f0edbc8..60ca979 100644 --- a/Koha/Template/Plugin/ItemTypes.pm +++ b/Koha/Template/Plugin/ItemTypes.pm @@ -21,7 +21,6 @@ use Modern::Perl; use Template::Plugin; use base qw( Template::Plugin ); -use Encode qw{encode decode}; use C4::Koha; @@ -32,7 +31,7 @@ sub GetDescription { my $sth = C4::Context->dbh->prepare($query); $sth->execute($itemtype); my $d = $sth->fetchrow_hashref(); - return encode( 'UTF-8', $d->{'description'} ); + return $d->{'description'}; } -- 1.7.10.4