Skip Menu |

This queue is for tickets about the HTML-Template-Set CPAN distribution.

Report information
The Basics
Id: 24217
Status: new
Priority: 0/
Queue: HTML-Template-Set

People
Owner: Nobody in particular
Requestors: DMITRI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.009
Fixed in: (no value)



Subject: Single-argument, hashref version of param() is not supported.
HTML::Template's param() method can be called with a single argument which is a hash reference. HTML::Template::Set does not understand this way of calling HTML::Template::param() and breaks things -- converting a hash ref into a lower-case string 'hash(0x234523)' which is of course an invalid parameter name. The fix is below. - Dmitri. --- cut --- @@ -409,6 +409,13 @@ sub param { my ($self, @args) = @_; + # This converts from a single-argument, hashref version of the APIs + # to the more common form. + if (1 == @args && 'HASH' eq ref($args[0])) { + my $hash = shift @args; + @args = %$hash; + } + if (@args == 1) { return $self->_get_translated_set_tag($args[0]); } else { --- cut ---