Skip Menu |

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

Report information
The Basics
Id: 27792
Status: resolved
Priority: 0/
Queue: Template-Alloy

People
Owner: Nobody in particular
Requestors: cpan [...] fireartist.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.004
Fixed in: (no value)



Subject: unexpected incompatibility with TT
I've changed an application to use Template::Alloy instead of TT, and it seems to be handling everything in the test suite with only 1 exception: I've been getting the following error: "undef error - Zero length content" which I believe I've narrowed down to the following snippet: [% FOREACH option = self.options %] [% FOREACH item = option.group %] [% INCLUDE $self.filename self = option %] [% END %] [% END %] It looks like the "self = option" assignment in the INCLUDE tag is being done /before/ the "$self.filename" is evaluated - whereas in TT, the assignment happens /after/ the INCLUDE variable name is evaluated. The error is occurring because 'filename' is defined in the outer 'self', and not in the 'option' object. I can work around this for now, by changing the variable name in the included file, but it'd be nice to know whether this is an intentional change. Cheers, Carl
That was an edge case that neither the TT suite nor the Template::Alloy suite tested for. There are now tests for that case. It is fixed to the correct behavior - which is that the filenames are processed first, then the args. Version 1.005 has been uploaded to CPAN. Template::Alloy was getting the args ready, then iterating on the files and resoving the filename as it iterated. It now gets all of the filenames ready first. Thanks for the report.