Fixed dispatcher, so $c->req->action(undef) works again
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index c6eed9e..2d06a5d 100644 (file)
@@ -56,7 +56,6 @@ sub detach {
 
 sub dispatch {
     my ( $self, $c ) = @_;
-
     if ( $c->action ) {
         $c->forward( join( '/', '', $c->action->namespace, '_DISPATCH' ) );
     }
@@ -113,7 +112,7 @@ sub forward {
                 if ($result) {
                     $local_args = 1;
                     $command    = $tail;
-                    push( @{$arguments}, @extra_args );
+                    unshift( @{$arguments}, @extra_args );
                     last DESCEND;
                 }
                 unshift( @extra_args, $tail );
@@ -194,10 +193,12 @@ sub prepare_action {
         }
 
         # If not, move the last part path to args
-
         unshift @args, pop @path;
     }
 
+    $c->log->debug( 'Path is "' . $c->req->match . '"' )
+      if ( $c->debug && $c->req->match );
+
     $c->log->debug( 'Arguments are "' . join( '/', @args ) . '"' )
       if ( $c->debug && @args );
 }