Fixed multiple appclass bug
Sebastian Riedel [Tue, 8 Nov 2005 17:40:41 +0000 (17:40 +0000)]
lib/Catalyst/Dispatcher.pm

index 490f549..4c6c139 100644 (file)
@@ -117,10 +117,10 @@ sub forward {
 
     unless ($result) {
 
-        my $class  = ref($command) || ref($c->component($command));
-        my $method = shift || 'process';
+        my $class  = ref($command) || ref( $c->component($command) );
+        my $method = shift         || 'process';
 
-        unless ( $class ) {
+        unless ($class) {
             my $error =
 qq/Couldn't forward to command "$command". Invalid action or component./;
             $c->error($error);
@@ -258,7 +258,7 @@ sub get_containers {
         # should catch any failures - or short-circuit this if this *is* a
         # bug in the visitor and gets fixed.
 
-        if (my $extra = $path[ ( scalar @match ) - 1 ]) {
+        if ( my $extra = $path[ ( scalar @match ) - 1 ] ) {
             $visitor->setSearchPath($extra);
             $match[-1]->accept($visitor);
             push( @match, $visitor->getResult ) if defined $visitor->getResult;
@@ -346,8 +346,6 @@ sub setup_actions {
       Catalyst::ActionContainer->new( { part => '/', actions => {} } );
     $self->tree( Tree::Simple->new( $container, Tree::Simple->ROOT ) );
 
-    $c->register_actions($c);
-
     foreach my $comp ( values %{ $c->components } ) {
         $comp->register_actions($c) if $comp->can('register_actions');
     }