[Catalyst] Default running over chained

Tomas Doran bobtfish at bobtfish.net
Thu Jan 28 09:37:14 GMT 2010


On 26 Jan 2010, at 22:13, xenoterracide at gmail.com wrote:

> I added a default action to my user controller. When I access /user/  
> a chained action is supposed to run, and it ran just fine until i  
> added the default action. Now the default runs instead of the  
> chained. No index exists in the controller
>
> sub base :Chained('/') : PathPrefix : CaptureArgs(0) { ... }
>
> sub list : Chained('base') : PathPart('') : Args(0) { ... }
>
> sub default : Path { ... }


Hmm, not sure if this i a bug or not as it's into ordering (which gets  
priority Path or Chained as they're both asking for the same URI).

If you actually want the magic fallback of 'default', you want  
sub :default : Private

Or why not try sub default : Chained('base') PathPart('') Args() {...}  
# Which should catch anything 'sub list' or other actions don't as it  
accepts any number of args..

Cheers
t0m



More information about the Catalyst mailing list