[Jifty-commit] r868 - in jifty/trunk: lib/Jifty/Action/Record

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Apr 17 21:17:21 EDT 2006


Author: alexmv
Date: Mon Apr 17 21:17:21 2006
New Revision: 868

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Action/Record/Update.pm

Log:
 r12395 at zoq-fot-pik:  chmrr | 2006-04-17 21:17:07 -0400
  * Update actions should still enforce constructors as being required.


Modified: jifty/trunk/lib/Jifty/Action/Record/Update.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action/Record/Update.pm	(original)
+++ jifty/trunk/lib/Jifty/Action/Record/Update.pm	Mon Apr 17 21:17:21 2006
@@ -35,6 +35,7 @@
 
     for my $pk (@{ $self->record->_primary_keys }) {
         $arguments->{$pk}{'constructor'} = 1;
+        $arguments->{$pk}{'mandatory'} = 1;
         # XXX TODO IS THERE A BETTER WAY TO NOT RENDER AN ITEM IN arguments
         $arguments->{$pk}{'render_as'} = 'Unrendered'; 
         # primary key fields should always be hidden fields
@@ -50,13 +51,17 @@
 from L<Jifty::Action>, where mandatory arguments B<must> be present
 for the action to run.
 
+However, constructor arguments are still required.
+
 =cut
 
 sub _validate_arguments {
-    my $self   = shift;
-    
-    $self->_validate_argument($_)
-      for grep {exists $self->argument_values->{$_}} $self->argument_names;
+    my $self = shift;
+
+    $self->_validate_argument($_) for grep {
+        exists $self->argument_values->{$_}
+            or $self->arguments->{$_}->{constructor}
+    } $self->argument_names;
 
     return $self->result->success;
 }


More information about the Jifty-commit mailing list