You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by se...@apache.org on 2003/11/10 05:10:34 UTC

cvs commit: jakarta-turbine-fulcrum/intake/src/java/org/apache/fulcrum/intake/model Field.java

seade       2003/11/09 20:10:34

  Modified:    intake/src/java/org/apache/fulcrum/intake/model Field.java
  Log:
  Porting changes from Turbine: 
    Fixes a bug introduced in the last bunch of patches whereby required fields were not being validated as such.
  
  Revision  Changes    Path
  1.5       +7 -5      jakarta-turbine-fulcrum/intake/src/java/org/apache/fulcrum/intake/model/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-fulcrum/intake/src/java/org/apache/fulcrum/intake/model/Field.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Field.java	10 Nov 2003 04:05:41 -0000	1.4
  +++ Field.java	10 Nov 2003 04:10:34 -0000	1.5
  @@ -370,14 +370,16 @@
               }
           }
   
  -        if (pp.containsKey(getKey()) 
  -                &&  StringUtils.isNotEmpty(pp.getString(getKey())))
  +        if (pp.containsKey(getKey()))
           {
               if (isDebugEnabled)
               {
                   log.debug(name + ": Found our Key in the request, setting Value");
               }
  -            setFlag = true;
  +            if (StringUtils.isNotEmpty(pp.getString(getKey())))
  +            {
  +                setFlag = true;
  +            }
               validate();
           }
           else if (pp.containsKey(getValueIfAbsent()) &&
  @@ -472,7 +474,7 @@
       public void setRequired(boolean v, String message)
       {
           this.required = v;
  -        if (v && !setFlag)
  +        if (v && (!setFlag || null == getTestValue()))
           {
               validFlag = false;
               this.message = message;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org