X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=9935d18ff49e9d677c50ee8eab74c2326ed4b9e3;hp=6da13290677779902335bf9cc4d963302415b4e6;hb=02d2619e275aefc0e4e6d4c08cbeff09d66d9f32;hpb=5513038d01b39b9a30d2c55e8ec85895bbe90f10 diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 6da1329..9935d18 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -892,15 +892,8 @@ sub execute { $class = $c->components->{$class} || $class; $c->state(0); - my $callsub = - ( caller(0) )[0]->isa('Catalyst::Action') - ? ( caller(2) )[3] - : ( caller(1) )[3]; - - my $action = ''; - if ( $c->debug ) { - $action = "$code"; + my $action = "$code"; $action = "/$action" unless $action =~ /\-\>/; $c->counter->{"$code"}++; @@ -911,6 +904,14 @@ sub execute { $c->state(0); return $c->state; } + + # determine if the call was the result of a forward + my $callsub_index = ( caller(0) )[0]->isa('Catalyst::Action') ? 2 : 1; + if ( ( caller($callsub_index) )[3] =~ /^NEXT/ ) { + # work around NEXT if execute was extended by a plugin + $callsub_index += 3; + } + my $callsub = ( caller($callsub_index) )[3]; $action = "-> $action" if $callsub =~ /forward$/;