X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=b44923b301fbb14e1e7232a82bc3e64d4cb84cb3;hb=2b01b53cf7f8b98568f13a99e18257f78d7fa858;hp=8f94316cd2624f4711425925e6fd3bfdba72cb6a;hpb=a0eca83861c733269dbafbaafbcc3ca0b0101e2b;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 8f94316..b44923b 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -80,13 +80,6 @@ sub forward { my $c = shift; my $command = shift; - # Get the calling class - my $caller = ( caller(0) )[0]; - if ( $caller->isa('Catalyst') ) { - if ( ( caller(2) )[3] =~ /detach$/ ) { $caller = caller(3) } - elsif ( ( caller(0) )[3] =~ /forward$/ ) { $caller = caller(1) } - } - unless ($command) { $c->log->debug('Nothing to forward to') if $c->debug; return 0; @@ -100,11 +93,8 @@ sub forward { my $command_copy = $command; unless ( $command_copy =~ s/^\/// ) { - my $prefix = - Catalyst::Utils::class2prefix( $caller, - $c->config->{case_sensitive} ) - || ''; - $command_copy = "${prefix}/${command}"; + my $namespace = $c->stack->[-1]->namespace; + $command_copy = "${namespace}/${command}"; } unless ( $command_copy =~ /\// ) { @@ -145,7 +135,9 @@ qq/Couldn't forward to command "$command". Invalid action or component./; code => $code, reverse => "$class->$method", class => $class, - namespace => $class, + namespace => Catalyst::Utils::class2prefix( + $class, $c->config->{case_sensitive} + ), } ); $result = $action; @@ -381,9 +373,9 @@ sub setup_actions { return unless $c->debug; my $privates = Text::SimpleTable->new( - [ 24, 'Private' ], - [ 23, 'Class' ], - [ 23, 'Method' ] + [ 20, 'Private' ], + [ 38, 'Class' ], + [ 12, 'Method' ] ); my $has_private = 0;