[Jifty-commit] r7221 - jifty/trunk/lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Wed Jun 10 20:23:56 EDT 2009


Author: sartak
Date: Wed Jun 10 20:23:55 2009
New Revision: 7221

Modified:
   jifty/trunk/lib/Jifty/Action.pm

Log:
Pull in action default values instead of assuming they'll be set in a form

Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm	(original)
+++ jifty/trunk/lib/Jifty/Action.pm	Wed Jun 10 20:23:55 2009
@@ -403,6 +403,14 @@
         $self->argument_values->{$arg} = shift;
     }
 
+    # Pull in default value if there is one
+    if (!exists($self->argument_values->{$arg})) {
+        if (defined(my $default = $self->arguments->{$arg}{default_value})) {
+            $self->values_from_request->{$arg} = 0;
+            $self->argument_values->{$arg} = $default;
+        }
+    }
+
     # Get it
     return $self->argument_values->{$arg};
 }


More information about the Jifty-commit mailing list