seade       2003/09/30 17:33:01

  Modified:    src/java/org/apache/turbine/services/intake/model Field.java
  Log:
  Fixes a bug introduced in the last bunch of patches whereby required fields were not 
being validated as such.
  
  Revision  Changes    Path
  1.19      +7 -5      
jakarta-turbine-2/src/java/org/apache/turbine/services/intake/model/Field.java
  
  Index: Field.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/model/Field.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Field.java        29 Sep 2003 05:58:47 -0000      1.18
  +++ Field.java        1 Oct 2003 00:33:01 -0000       1.19
  @@ -372,14 +372,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()) &&
  @@ -474,7 +476,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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to