From: Kennedy Clark Date: Sun, 30 May 2010 00:19:51 +0000 (+0000) Subject: Fix for RT #56970 X-Git-Tag: v5.8005~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Manual.git;a=commitdiff_plain;h=76776098d4731f120ecb88210b29a4496063e097 Fix for RT #56970 --- diff --git a/lib/Catalyst/Manual/Cookbook.pod b/lib/Catalyst/Manual/Cookbook.pod index 1975e5a..1e0832b 100644 --- a/lib/Catalyst/Manual/Cookbook.pod +++ b/lib/Catalyst/Manual/Cookbook.pod @@ -133,7 +133,7 @@ reference. sub add_item : Local { my ( $self, $c ) = @_; - my $item_id = $c->req->param("item"); + my $item_id = $c->req->params->{item}; push @{ $c->session->{items} }, $item_id; @@ -387,8 +387,8 @@ the user is a member. sub login : Local { my ($self, $c) = @_; - if ( my $user = $c->req->param("user") - and my $password = $c->req->param("password") ) + if ( my $user = $c->req->params->{user} + and my $password = $c->req->param->{password} ) { if ( $c->authenticate( username => $user, password => $password ) ) { $c->res->body( "hello " . $c->user->name ); @@ -454,7 +454,7 @@ pretty nasti!). For example: sub feed_moose : Local { my ( $self, $c ) = @_; - $c->model( "Moose" )->eat( $c->req->param("food") ); + $c->model( "Moose" )->eat( $c->req->params->{food} ); } With this action, anyone can just come into the moose cage and feed @@ -476,7 +476,7 @@ And now our action should look like this: my ( $self, $c ) = @_; if ( $c->check_roles( "moose_feeder" ) ) { - $c->model( "Moose" )->eat( $c->req->param("food") ); + $c->model( "Moose" )->eat( $c->req->params->{food} ); } else { $c->stash->{error} = "unauthorized"; }