Dancer2 icon indicating copy to clipboard operation
Dancer2 copied to clipboard

Redirect during rendering template results in subsequent recursion errors

Open abeverley opened this issue 3 years ago • 2 comments

I'm just opening this issue as a placeholder for a planned PR.

The issue is that if for some reason a redirect takes place during the render of a Template::Toolkit template, then any subsequent calls to that templating engine result in Failed to render template: file error - recursion into...

This is because the redirect causes a long-jump out of Template::Toolkit and it thinks it never finished the render. This is because the renderer's eval doesn't catch the long-jump: https://metacpan.org/source/ATOOMIC/Template-Toolkit-3.009/lib/Template/Document.pm#L160

I propose adding a guard to ensure this doesn't happen. PR to follow.

abeverley avatar May 15 '21 07:05 abeverley

Good catch @abeverley, looking forward to the PR.

SysPete avatar May 15 '21 10:05 SysPete

Thanks @SysPete please see #1622. It's as much there for discussion as anything. There is one outstanding problem which I could really do with some help with, as described in the comments in the PR.

abeverley avatar May 15 '21 13:05 abeverley

Resolved in #1622. Thanks everyone!

cromedome avatar Feb 05 '23 16:02 cromedome