Skip Menu |

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

Report information
The Basics
Id: 54404
Status: rejected
Priority: 0/
Queue: Template-Toolkit

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

Bug Information
Severity: Critical
Broken in:
  • 2.19
  • 2.22
Fixed in: (no value)



Subject: methods don't work if top data reference is an object
Sample: my $self = bless {},$class; my $tt = Template->new(); $tt->process($template, $self, \$content); Using [% session %] doesn't call the method "session" of "$self" as expected but tries to access $self->{session}. Adding $self->{data} = $self; and using [% data.session %] works as described in the manual pages. [% session() %] doesn't work, too.
This is an intentional design feature. All template data must be defined in a hash reference.