[Catalyst] DispatchType::Chained, and $c->go() calling things twice...

joe higton draxil at gmail.com
Fri Apr 24 15:09:40 GMT 2009


Hi,
     We've got a catalyst app that involves a few magic prefix paths
which alter the behavior of things for the rest of the application,
but which can basically go before any other path in the system. So to
handle this with the minimum of effort when we get a request to one of
these paths we just put some stuff in the stash, and then chop our
prefix off the path and then re-run the request by calling $c->go(),
so something like this:

 my $path =3D '/'.join '/', @rest_of_path;

 $c->request->path($path);
 $c->dispatcher->prepare_action($c);

 $c->go($c->action, $c->request->args,  $c->request->captures);


This all seems to work fine enough, except that all the "chained"
handlers (apart from the endpoints) seem to get called twice. I've
included a little test-app to illustrate this.

Is this just happening because this is a dumb way of doing things or
is there something broken here?

Thanks,
   Joe.

-- =

Gmail is watching you!!!!!!

Please don't publish this email address or use it for anything SPAM
risky. My more public email address is joe at draxil.uklinux.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: go_chain.tbz
Type: application/octet-stream
Size: 770 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090424/46ba=
24bd/go_chain.obj


More information about the Catalyst mailing list