projects
/
koha.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10807ef
)
template::param handles empty array/hash refs better
author
Christopher Hall
<chris.hall@catalyst.net.nz>
Fri, 4 Feb 2011 02:10:59 +0000
(15:10 +1300)
committer
Christopher Hall
<chris.hall@catalyst.net.nz>
Fri, 4 Feb 2011 02:10:59 +0000
(15:10 +1300)
C4/Templates.pm
patch
|
blob
|
history
diff --git
a/C4/Templates.pm
b/C4/Templates.pm
index
9a07d95
..
91b57fb
100644
(file)
--- a/
C4/Templates.pm
+++ b/
C4/Templates.pm
@@
-109,6
+109,8
@@
sub param{
my $key = shift;
my $val = shift;
utf8::encode($val) if utf8::is_utf8($val);
+ if( ref($val) eq 'ARRAY' && ! scalar @$val ){ $val = undef; }
+ elsif( ref($val) eq 'HASH' && ! scalar %$val ){ $val = undef; }
$self->{VARS}->{$key} = $val;
}
}