[Catalyst] Documentation bug in Catalyst::Request

Kieren Diment diment at gmail.com
Wed Oct 18 14:30:49 CEST 2006


On 18/10/06, Toby Corkindale <tjc at wintrmute.net> wrote:
>
> Bug in Catalyst::Request.
> It says:
>   $req->action
>        Returns the requested action as a Catalyst::Action object.




That is what happens.  However it is stringifies to the path.

debugger output:

~/Desktop/dev/Catalyst/trunk/Catalyst-Helper-FastCGI/t/lib/FcgiTest$ perl -d
script/fcgitest_server.pl

Loading DB routines from perl5db.pl version 1.28
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(script/fcgitest_server.pl:15):
15:     my $debug               DB<1> c
You can connect to your server at http://zaphod.local:3000
FcgiTest::Controller::Root::local_action(/Users/kd/Desktop/dev/Catalyst/trunk/Catalyst-Helper-FastCGI/t/lib/FcgiTest/script/../lib/FcgiTest/Controller/Root.pm:22):
22:         $c->res->body('hit localaction');
  DB<1> x $c->action
0  Catalyst::Action=HASH(0x1c5b058)
   'attributes' => HASH(0x1c3b3c0)
      'Path' => ARRAY(0x1c587d4)
         0  '/local_action'
   'class' => 'FcgiTest::Controller::Root'
   'code' => CODE(0x1c32168)
      -> &FcgiTest::Controller::Root::local_action in
/Users/kd/Desktop/dev/Catalyst/trunk/Catalyst-Helper-FastCGI/t/lib/FcgiTest/script/../lib/FcgiTest/Controller/Root.pm:19-23
   'name' => 'local_action'
   'namespace' => ''
   'reverse' => 'local_action'
  DB<2> p $c->action
local_action
  DB<3> q


I'll amend the docs to note the stringification




However, it just returns the "action", (ie. foo/bar).
> To get a genuine Catalyst::Action object, you need to call $c->action.
> I'd want to keep backwards compatibility, so maybe note in C::R that the
> method
> returns the equivelent of $c->action->action, and that you might want to
> investigate calling $c->action if you want a Catalyst::Action object.
>
> -Toby
>
> --
> Turning and turning in the widening gyre/The falcon cannot hear the
> falconer;
> Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the
> world
> (gpg --keyserver www.co.uk.pgp.net --recv-key B1CCF88E)
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20061018/78cbf8df/attachment.htm 


More information about the Catalyst mailing list