From: Tomas Doran Date: Mon, 20 Apr 2009 18:39:26 +0000 (+0000) Subject: Bugfix for 5.8 regression found in C::C::DBIC::API X-Git-Tag: 5.80002~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=e99ec2dcc083716c88a86a89b9017c6a78a260a9 Bugfix for 5.8 regression found in C::C::DBIC::API --- diff --git a/Changes b/Changes index a601b19..fd8b2eb 100644 --- a/Changes +++ b/Changes @@ -1,9 +1,11 @@ # This file documents the revision history for Perl extension Catalyst. + - Fix so that calling $c->req->parameters(undef) does not flatten + the request parameters with undef + test (t0m) - Fix so that width of table of unattached actions for debugging - ::DispatchType::Chained varies according to your terminal width + ::DispatchType::Chained varies according to your terminal width (Oleg Kostyuk) - - Fix warning message about linearized @ISA in Catalyst::Component + - Fix warning message about linearized @ISA in Catalyst::Component (Emanuele Zeppieri) - Require MX::MethodAttributes 0.06 to avoid issues with saying use base 'Catalyst::Controller'; use Moose; losing actions (t0m) diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index c859fd2..4f9d7dc 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -76,15 +76,19 @@ has parameters => ( default => sub { {} }, ); -before parameters => sub { - my ($self, $params) = @_; - if ( $params && !ref $params ) { - $self->_context->log->warn( - "Attempt to retrieve '$params' with req->params(), " . - "you probably meant to call req->param('$params')" ); - $params = undef; - } - +around parameters => sub { + my ($orig, $self, $params) = @_; + if ($params) { + if ( !ref $params ) { + $self->_context->log->warn( + "Attempt to retrieve '$params' with req->params(), " . + "you probably meant to call req->param('$params')" + ); + $params = undef; + } + return $self->$orig($params); + } + $self->$orig(); }; has base => (