Closed KES777 closed 6 years ago
This is because ->render_maybe
changes the stash, even when operation fails.
Look at next surprising code:
package Mojolicoius:Controller:xxx;
sub yyy {
....
$c->stash->{ template } = 'some/template';
$c->render_maybe( some => 'data' ); # this deletes 'template' stash value
$c->render; # here will xxx/yyy willbe rendered instead of some/template
}
This is not a problem, but maybe should be taken into account: Because ->render_maybe changes stash. The M:P:DefaultHandlers:142 implicitly sets up handler to 'ep'. Thus second call to _fallbacks M:P:DefaultHelpers:123 will always try to use ..ep templates
this prevents to check format