From: John Napiorkowski Date: Wed, 25 Mar 2015 15:09:53 +0000 (-0500) Subject: do not change the best_action when args(0) if current best_action is also args(0) X-Git-Tag: 5.90085~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=09914a47700308f8588e65eb4a29d378c192aee8 do not change the best_action when args(0) if current best_action is also args(0) --- diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 310b772..b733242 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -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), }; }