Hi,

On 18/06/10 10:55, Octavian Rasnita wrote:
I tried to put:
$Template::Directive::WHILE_MAX = 3000;
in process(), in render() (before $self->next::method(@_)), and outside the subroutines.
Even after setting this variable, the app still prints the error:
undef error - WHILE loop terminated (> 1000 iterations)
The part of the body that prints this error is generated using:
my $body = $c->view->render($c, 'template.tt');
Do you have any idea why it is not working?

It's compiled into the .ttc as a number. Either delete your cached templates, or turn off caching, or modify the sub while in Template/Directive.pm to use the variable rather than interpreting, this might do it:

# WHILE
do {
    my \$_tt_failsafe = \$Template::Directive::WHILE_MAX;
LOOP:
    while (--\$_tt_failsafe && ($expr)) {
$block
    }
die "WHILE loop terminated (> \$Template::Directive::WHILE_MAX iterations)\\n"
        unless \$_tt_failsafe;
};
EOF

Tom

_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to