do not change the best_action when args(0) if current best_action is also args(0)
John Napiorkowski [Wed, 25 Mar 2015 15:09:53 +0000 (10:09 -0500)]
lib/Catalyst/DispatchType/Chained.pm

index 310b772..b733242 100644 (file)
@@ -292,13 +292,17 @@ sub recurse_match {
                     (
                         !@parts && 
                         defined($args_attr) && 
-                        $args_attr eq "0"
+                        (
+                            $args_attr eq "0" &&
+                            ( exists($best_action->{args_attr}) && defined($best_action->{args_attr}) ?  ($best_action->{args_attr} ne 0) : 1 )
+                        )
                     )
                 ){
                     $best_action = {
                         actions => [ $action ],
                         captures=> [],
                         parts   => \@parts,
+                        args_attr => $args_attr,
                         n_pathparts => scalar(@pathparts),
                     };
                 }