Skip to content

Commit

Permalink
fixed small handler detection bug in Mojolicious::Renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 8, 2014
1 parent 232bed6 commit 0de8d93
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,7 +1,9 @@

4.92 2014-04-06
4.92 2014-04-08
- Removed deprecated use of hash references for optgroup generation with
select_field helper.
- Improved dumper helper to escape unprintable characters.
- Fixed small handler detection bug in Mojolicious::Renderer.

4.91 2014-03-29
- Added daemonize method to Mojo::Server.
Expand Down
1 change: 1 addition & 0 deletions lib/Mojolicious/Renderer.pm
Expand Up @@ -227,6 +227,7 @@ sub _render_template {

# Find handler and render
my $handler = $options->{handler} ||= $self->template_handler($options);
return undef unless $handler;
if (my $renderer = $self->handlers->{$handler}) {
return 1 if $renderer->($self, $c, $output, $options);
}
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/dispatcher_lite_app.t
Expand Up @@ -52,7 +52,8 @@ hook before_dispatch => sub {
# Custom dispatcher /custom
hook before_dispatch => sub {
my $c = shift;
$c->render(text => $c->param('a'), status => 205)
$c->render_maybe
or $c->render(text => $c->param('a'), status => 205)
if $c->req->url->path->contains('/custom');
};

Expand Down

0 comments on commit 0de8d93

Please sign in to comment.