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

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Fri May 15 09:41:11 GMT 2009


Author: t0m
Date: 2009-05-15 09:41:11 +0000 (Fri, 15 May 2009)
New Revision: 10166

Modified:
   Catalyst-Runtime/5.80/trunk/Changes
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
Log:
Fix on demand parsing of ->req->parameters

Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes	2009-05-14 23:41:21 UTC (rev 10165)
+++ Catalyst-Runtime/5.80/trunk/Changes	2009-05-15 09:41:11 UTC (rev 10166)
@@ -23,6 +23,8 @@
           to report 'Unknown Error' (t0m)
         - Support adding Moose::Roles to the plugin list. These are applied to
           MyApp after plugins have been pushed onto @ISA (t0m)
+        - Fix calling $c->req->parameters as the first thing you do when
+          parse_on_demand is on (t0m)
 
 5.80003 2009-04-29 16:23:53
         - Various POD tweaks. (hdp, dandv)

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm	2009-05-14 23:41:21 UTC (rev 10165)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request.pm	2009-05-15 09:41:11 UTC (rev 10166)
@@ -36,14 +36,6 @@
   lazy => 1,
 );
 
-# Moose TODO:
-# - Can we lose the before modifiers which just call prepare_body ?
-#   they are wasteful, slow us down and feel cluttery.
-# Can we call prepare_body at BUILD time?
-# Can we make _body an attribute, have the rest of 
-# these lazy build from there and kill all the direct hash access
-# in Catalyst.pm and Engine.pm?
-
 has _context => (
   is => 'rw',
   weak_ref => 1,
@@ -58,11 +50,6 @@
   default => sub { {} },
 );
 
-before body_parameters => sub {
-  my ($self) = @_;
-  $self->_context->prepare_body();
-};
-
 has uploads => (
   is => 'rw',
   required => 1,
@@ -76,6 +63,20 @@
   default => sub { {} },
 );
 
+# TODO:
+# - Can we lose the before modifiers which just call prepare_body ?
+#   they are wasteful, slow us down and feel cluttery.
+
+#  Can we make _body an attribute, have the rest of
+#  these lazy build from there and kill all the direct hash access
+#  in Catalyst.pm and Engine.pm?
+
+before $_ => sub {
+    my ($self) = @_;
+    my $context = $self->_context || return;
+    $context->prepare_body;
+} for qw/parameters body_parameters/;
+
 around parameters => sub {
     my ($orig, $self, $params) = @_;
     if ($params) {




More information about the Catalyst-commits mailing list