Add Reaction to conflicts.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Request.pm
index c859fd2..4f9d7dc 100644 (file)
@@ -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 => (