seade       2003/09/30 17:25:19

  Modified:    src/java/org/apache/turbine/services/intake/model Tag:
                        TURBINE_2_3_BRANCH 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
  No                   revision
  No                   revision
  1.15.2.4  +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.15.2.3
  retrieving revision 1.15.2.4
  diff -u -r1.15.2.3 -r1.15.2.4
  --- Field.java        29 Sep 2003 05:58:32 -0000      1.15.2.3
  +++ Field.java        1 Oct 2003 00:25:19 -0000       1.15.2.4
  @@ -371,14 +371,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()) &&
  @@ -473,7 +475,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