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: 19662
Status: resolved
Worked: 30 min
Priority: 0/
Queue: HTML-Template-Compiled

People
Owner: Nobody in particular
Requestors: chagglund [...] shrinkingplanet.ca
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.64
Fixed in: 0.67



Subject: global_vars not working/partially working?
Maybe this is just me, if so I have no idea what I'm doing wrong. I have data structure like, say: $fields = [{ parameter_name => foo, radiobtn => 1, options => [{ value => 1, diplay => 'yes', },{ value => 0, diplay => 'no', }], },{ [other field entries] }]; Inside the tmpl, loop over the fields, loop over the options, I am unable to write out the parameter_name of the field while within the rendering of the options. I tried with global vars set as 1 or 3 to just use <TMPL_VAR parameter_name>. I also tried with global vars as 2 or 3 to use <TMPL_VAR ...parameter_name>. With file caching I got very weird results, most of the time totally unable to access parameter_name from within the options loop. Clearing the cache would seem to let it draw it but strangely only for the first option loop iteration (and then seeminly only until I overwrote the tmpl file again). Seemed very strange. The absolutely only way I can get it to work is to add extra code to shove the parameter_name into each element of the options array/loop. Any ideas? Seen this before? Thanks for any info. This is running on perl 5.6.1 with the HTC version 0.64 under mod_perl with Apache 1.3 ... I'll try to put together some small piece of code to demonstrate.
From: TINITA
hi, thanks for your report; a short piece of template would be a great help =)
ok, I can reproduce the error - it only happens with included templates and file-caching. i don't pass the global_vars-parameter correctly to included templates. it will be fixed in 0.66. thanks again.
Show quoted text
> it will be fixed in 0.66.
maybe you could check if the problem still exists? if i don't hear any complaints i'll close the bug.
Subject: Re: [rt.cpan.org #19662] global_vars not working/partially working?
Date: Sun, 04 Jun 2006 10:02:27 -0400
To: bug-HTML-Template-Compiled [...] rt.cpan.org
From: Chris Hagglund <chagglund [...] shrinkingplanet.ca>
via RT wrote: Show quoted text
><URL: http://rt.cpan.org/Ticket/Display.html?id=19662 > > > >
>>it will be fixed in 0.66. >> >>
> >maybe you could check if the problem still exists? if i don't hear >any complaints i'll close the bug. >
Thank you so much for taking the time to look into this. I've now had a chance to poke further and I'm still having some problem, but there is some improvement also. First I'll verify that I am having this problem in an included template. What I have discovered is that the ... notation works up until a TMPL_IF is encountered, and then it seems to fail, for the remainder of the inner loop. The same thing happens again on the next iteration of the outer loop, it works in the inner loop up until a TMPL_IF. I have now made a small demo script that replicates it too.
found the bug (modifying the stack for global_vars when it shouldn't be modified). fix will be in 0.67. thanks again!
On Mo. 05. Jun. 2006, 13:56:37, TINITA wrote: Show quoted text
> found the bug (modifying the stack for global_vars when it shouldn't
be Show quoted text
> modified). fix will be in 0.67. > > thanks again!
so, now it should be really fixed =)