- Made forward use $c->component($command) instead of $c->components->{$command}...
Matt S Trout [Wed, 2 Nov 2005 01:59:07 +0000 (01:59 +0000)]
lib/Catalyst/Dispatcher.pm
t/live/lib/TestApp/Controller/Action/Forward.pm

index 851a3b0..966a4e2 100644 (file)
@@ -112,7 +112,9 @@ sub forward {
 
     unless ( $result ) {
 
-        unless ( $c->components->{$command} ) {
+        my $comp;
+
+        unless ( $comp = $c->component($command) ) {
             my $error =
 qq/Couldn't forward to command "$command". Invalid action or component./;
             $c->error($error);
@@ -120,10 +122,10 @@ qq/Couldn't forward to command "$command". Invalid action or component./;
             return 0;
         }
 
-        my $class  = $command;
+        my $class  = ref $comp;
         my $method = shift || 'process';
 
-        if ( my $code = $c->components->{$class}->can($method) ) {
+        if ( my $code = $class->can($method) ) {
             my $action = Catalyst::Action->new(
                 {
                     name      => $method,
index 02ce255..56a50f1 100644 (file)
@@ -25,7 +25,7 @@ sub four : Private {
 
 sub five : Local {
     my ( $self, $c ) = @_;
-    $c->forward('TestApp::View::Dump::Request');
+    $c->forward('View::Dump::Request');
 }
 
 sub jojo : Local {