[Jifty-commit] r2629 - in jifty/trunk: lib/Jifty/Plugin/REST

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Jan 26 23:09:54 EST 2007


Author: trs
Date: Fri Jan 26 23:09:54 2007
New Revision: 2629

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm

Log:
 r19122 at zot:  tom | 2007-01-26 23:08:07 -0500
 Since most REST actions won't be run from HTML forms, default values never getted passed in.  Make sure they get set for arguments which have not been explicitly passed as blank.


Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm	Fri Jan 26 23:09:54 2007
@@ -589,6 +589,13 @@
 
     Jifty->api->is_allowed( $action_name ) or abort(403);
 
+    my $params = $action->arguments;
+    for my $key ( keys %$params ) {
+        next if not exists $params->{ $key }{'default_value'};
+        next if $action->has_argument( $key );
+        $action->argument_value( $key => $params->{ $key }{'default_value'} );
+    }
+
     $action->validate;
 
     local $@;


More information about the Jifty-commit mailing list