Skip Menu |

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

Maintainer(s)' notes

Note: there is a bug with caching and TMPL_INCLUDE_VAR since 0.97_004 until 0.98. either use an earlier version or upgrade to 0.98_001. Another workaround is to precompile all templates to file_cache_dir. The bug happens when including a template via INCLUDE_VAR and the template is not yet compiled or has changed.

I'm sorry if the change about aliases came quite unannounced. I didn't expect any problems since dollar signs are not allowed in template vars, but I heard from at least one case where people were doing exactly this.
Please do not use unallowed characters in template vars. Allowed are (from the HTML::Template::FAQ): Numbers, letters, '.', '/', '+', '-' and '_'.
This should work in HTML::Template::Compiled::Classic.
in HTML::Template::Compiled you should be only using numbers, letters and _.
The dot, for example, is special. If you need to get a hash key from the template parameters with special charcaters, you can try <tmpl_var _.$var$name$with$dollars >

There will be a workaround in the next version:
local $HTML::Template::Compiled::Compiler::DISABLE_NEW_ALIAS = 1;


Please report any bug you find.
The code is now hosted on https://github.com/perlpunk/HTML-Template-Compiled
If you have a bug report, you can also post it there in the "Issues" section.
In the bugreport, please include, if possible, the module version, perl version and a testcase that reproduces the error; that makes it easier to find the bug.

The issue with not reloading includes of includes should be fixed in version 0.95_003. If you have any problems though please report!

Using query() and the dot syntax might not work together always. If you have a tmpL_var name="..foo" (going up the stash one level) the var foo is not detected and will not be reported by the query() function. Since the dot syntax is for dereferencing hashes and method calls the query function might not make sense anyway. I believe it is a bad idea to let the program do things if the template is using a certain variable.

Thanks!

Report information
The Basics
Id: 33383
Status: resolved
Priority: 0/
Queue: HTML-Template-Compiled

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

Bug Information
Severity: Important
Broken in: 0.90
Fixed in: 0.92



Subject: <TMPL_IF_DEFINED ...></TMPL_IF> does not work
When using <TMPL_IF_DEFINED> tag the closing tag is not recognized correctly. The closing tag </TMPL_IF> does not work when not using an <TMPL_ELSE> tag. </TMPL_IF_DEFINED> does not work either: ------------------------------------------------------------------- Script 1 (TMPL_IF_DEFINED with an TMPL_ELSE-tag => correct output) Source: use strict; use warnings; use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( tagstyle => [qw(-classic -comment +asp)], scalarref => \<<'EOT'); Simple IF: <%IF a%>a is true<%/IF%> IF_DEFINED: <%IF_DEFINED a%>a ist true<%ELSE%>a is false<%/IF%> EOT print $htc->output(); $htc->param(a => 'test'); print $htc->output(); __END__ Output: Simple IF: IF_DEFINED: a is false Simple IF: a is true IF_DEFINED: a is true ------------------------------------------------------------------- Script 2 (TMPL_IF_DEFINED with TMPL_ELSE and closing /TMPL_IF_DEFINED => error) Source: use strict; use warnings; use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( tagstyle => [qw(-classic -comment +asp)], scalarref => \<<'EOT'); Simple IF: <%IF a%>a is true<%/IF%> IF_DEFINED: <%IF_DEFINED a%>a ist true<%ELSE%>a is false<%/IF_DEFINED%> EOT print $htc->output(); $htc->param(a => 'test'); print $htc->output(); __END__ Output: Missing closing tag for 'ELSE' atend of O0RZb6qNE6CYpq0WAMWH9Q line 3 ------------------------------------------------------------------- Script 3 (TMPL_IF_DEFINED without TMPL_ELSE and closing /TMPL_IF => error) Source: use strict; use warnings; use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( tagstyle => [qw(-classic -comment +asp)], scalarref => \<<'EOT'); Simple IF: <%IF a%>a is true<%/IF%> IF_DEFINED: <%IF_DEFINED a%>a ist true<%/IF%> EOT $htc->param(a => 0); print $htc->output(); __END__ Output: 'TMPL_IF' does not match opening tag (IF_DEFINED)at zv9K5yndlxYHh526Pt2h7g line 2 at /usr/lib/perl5/vendor_perl/5.8.8/HTML/Template/Compiled/Compiler.pm line 324 ------------------------------------------------------------------- Script 4 (TMPL_IF_DEFINED without TMPL_ELSE and closing /TMPL_IF_DEFINED => error) Source: use strict; use warnings; use HTML::Template::Compiled; my $htc = HTML::Template::Compiled->new( tagstyle => [qw(-classic -comment +asp)], scalarref => \<<'EOT'); Simple IF: <%IF a%>a is true<%/IF%> IF_DEFINED: <%IF_DEFINED a%>a ist true<%/IF_DEFINED%> EOT $htc->param(a => 0); print $htc->output(); __END__ Output: Missing closing tag for 'IF_DEFINED' atend of Cbri/L6Cfppc36zAvWL1/Q line 3
From: TINITA [...] cpan.org
On Mo. 18. Feb. 2008, 05:33:34, STEFFENW wrote: Show quoted text
> When using <TMPL_IF_DEFINED> tag the closing tag is not recognized > correctly. The closing tag </TMPL_IF> does not work when not using an > <TMPL_ELSE> tag. </TMPL_IF_DEFINED> does not work either:
thank you for the detailed bug report, luckily this was an easy fix; it will be in the next realeas... tina
forgot: script 3 is the correct one which should work with the next realeas.