Thank you!

That was the problem.

--
Octavian

  ----- Original Message ----- 
  From: Tom Molesworth 
  To: [email protected] 
  Sent: Friday, June 18, 2010 1:29 PM
  Subject: Re: [Templates] Setting $Template::Directive::WHILE_MAX in Catalyst 
apps


  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



  __________ Information from ESET NOD32 Antivirus, version of virus signature 
database 5206 (20100618) __________

  The message was checked by ESET NOD32 Antivirus.

  http://www.eset.com



------------------------------------------------------------------------------


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



  __________ Information from ESET NOD32 Antivirus, version of virus signature 
database 5206 (20100618) __________

  The message was checked by ESET NOD32 Antivirus.

  http://www.eset.com




__________ Information from ESET NOD32 Antivirus, version of virus signature 
database 5206 (20100618) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

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

Reply via email to