[Jifty-commit] r5228 - in jifty/trunk: lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Mon Mar 17 14:43:45 EDT 2008


Author: alexmv
Date: Mon Mar 17 14:43:45 2008
New Revision: 5228

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

Log:
 r28572 at kohr-ah:  chmrr | 2008-03-17 14:43:18 -0400
  * 'mandatory' columns are not mandatory if they have a default and didn't appear in the form.


Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm	(original)
+++ jifty/trunk/lib/Jifty/Action.pm	Mon Mar 17 14:43:45 2008
@@ -944,7 +944,7 @@
     
     # When it isn't even given, check if it's mandatory and whine about it
     if ( !defined $value || !length $value ) {
-        if ( $field_info->{mandatory} ) {
+        if ( $field_info->{mandatory} and ($self->has_argument($field) or not defined $field_info->{default_value})) {
             return $self->validation_error( $field => _("You need to fill in this field") );
         }
     }


More information about the Jifty-commit mailing list