Skip to content

Commit

Permalink
fixed small rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 30, 2011
1 parent 2b0f256 commit 1a324ce
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -2,6 +2,7 @@ This file documents the revision history for Perl extension Mojolicious.

2.18 2011-10-30 00:00:00
- Improved documentation.
- Fixed small rendering bug.

2.17 2011-10-30 00:00:00
- Fixed bug in "user_agent.t".
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojolicious/Controller.pm
Expand Up @@ -332,7 +332,7 @@ sub render_json {
return $self->render($args);
}

sub render_later { shift->stash->{'mojo.rendered'} = 1 }
sub render_later { shift->stash->{'mojo.rendered'}++ }

# "Excuse me, sir, you're snowboarding off the trail.
# Lick my frozen metal ass."
Expand Down Expand Up @@ -407,12 +407,11 @@ sub rendered {

# Finish transaction
my $stash = $self->stash;
unless ($stash->{'mojo.finished'}) {
unless ($stash->{'mojo.finished'}++) {
$res->code(200) unless $res->code;
my $app = $self->app;
$app->plugins->run_hook_reverse(after_dispatch => $self);
$app->sessions->store($self);
$stash->{'mojo.finished'} = 1;
}
$self->tx->resume;

Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -356,7 +356,7 @@ sub _dispatch_callback {
my ($self, $c, $field, $staging) = @_;

# Routed
$c->stash->{'mojo.routed'} = 1;
$c->stash->{'mojo.routed'}++;
$c->app->log->debug(qq/Dispatching callback./);

# Dispatch
Expand Down Expand Up @@ -409,7 +409,7 @@ sub _dispatch_controller {
# Call action
my $stash = $c->stash;
if ($app->can($method)) {
$stash->{'mojo.routed'} = 1 unless $staging;
$stash->{'mojo.routed'}++ unless $staging;
$continue = $app->$method;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Static.pm
Expand Up @@ -32,7 +32,7 @@ sub dispatch {

# Serve static file
return unless $self->serve($c, join('/', @parts));
$stash->{'mojo.static'} = 1;
$stash->{'mojo.static'}++;
$c->rendered;

return 1;
Expand Down

0 comments on commit 1a324ce

Please sign in to comment.