[Catalyst-commits] r9765 - in Catalyst-Runtime/5.80/trunk: . lib/Catalyst

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Mon Apr 20 18:39:26 GMT 2009


Author: t0m
Date: 2009-04-20 19:39:26 +0100 (Mon, 20 Apr 2009)
New Revision: 9765

Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
Log:
Bugfix for 5.8 regression found in C::C::DBIC::API


Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2009-04-20 18:16:18 UTC (rev 9764)
+++ Catalyst-Runtime/5.80/trunk/Changes	2009-04-20 18:39:26 UTC (rev 9765)
@@ -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)

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm	2009-04-20 18:16:18 UTC (rev 9764)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm	2009-04-20 18:39:26 UTC (rev 9765)
@@ -76,15 +76,19 @@
   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 => (




More information about the Catalyst-commits mailing list