Bug 11944: TT Plugins should not encode strings
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 17 Mar 2014 12:33:43 +0000 (13:33 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Tue, 13 Jan 2015 16:07:07 +0000 (13:07 -0300)
Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Dobrica Pavlinusic <dpavlin@rot13.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Koha/Template/Plugin/AuthorisedValues.pm
Koha/Template/Plugin/Branches.pm
Koha/Template/Plugin/ItemTypes.pm

index 0198ab4..36ddce1 100644 (file)
@@ -21,13 +21,11 @@ use Modern::Perl;
 use Template::Plugin;
 use base qw( Template::Plugin );
 
-use Encode qw{encode is_utf8};
-
 use C4::Koha;
 
 sub GetByCode {
     my ( $self, $category, $code, $opac ) = @_;
-    return encode( 'UTF-8', GetAuthorisedValueByCode( $category, $code, $opac ) );
+    return GetAuthorisedValueByCode( $category, $code, $opac );
 }
 
 sub Get {
@@ -65,8 +63,7 @@ The parameters are identical to those used by the subroutine C4::Koha::GetAuthor
 
 sub GetByCode {
     my ( $self, $category, $code, $opac ) = @_;
-    my $av = GetAuthorisedValueByCode( $category, $code, $opac );
-    return $av;
+    return GetAuthorisedValueByCode( $category, $code, $opac );
 }
 
 =head2 GetAuthValueDropbox
index 781cd21..92db535 100644 (file)
@@ -21,7 +21,6 @@ use Modern::Perl;
 
 use Template::Plugin;
 use base qw( Template::Plugin );
-use Encode qw{encode is_utf8};
 
 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->{branchname};
+    return $b ? $b->{'branchname'} : q{};
 }
 
 sub GetLoggedInBranchcode {
@@ -51,7 +50,7 @@ sub GetURL {
     my $sth   = C4::Context->dbh->prepare($query);
     $sth->execute($branchcode);
     my $b = $sth->fetchrow_hashref();
-    return encode( 'UTF-8', $b->{'branchurl'} );
+    return $b->{branchurl};
 }
 
 1;
index c913189..941ce03 100644 (file)
@@ -21,7 +21,6 @@ use Modern::Perl;
 
 use Template::Plugin;
 use base qw( Template::Plugin );
-use Encode qw{encode decode};
 
 use C4::Koha;