You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by David Wartell <da...@ablehost.com> on 2002/02/10 20:00:30 UTC

bug in Intake Turbine 2.2?

I think a bug has surfaced in Intake from Turbine 2.1 to 2.2.

The  boolean validate(ParameterParser pp) method in 
org.apache.turbine.services.intake.model.Field no longer calls 
doSetValue(pp) if the value is invalid.  This causes problems if you 
expect Intake to have the previously submitted values available for 
prefilling the fields when refreshing a screen with error message(s).

It was also causing StringField to throw a NullPointerException when a 
StringField was invalid because the value was null.

Hope im not missing something or off topic.  A patch for Field.java is 
included below.

Thank You,
David Wartell
AbleHost
http://www.ablehost.com

diff Field.java Field.java.fixed

405c405,406
<      * Compares request data with constraints and sets the valid flag.
---
 >      * Compares request data with constraints, sets the valid flag,
 >      * and sets the test value
421a423
 >                 // check validity for each field
434,439d435
<
<             if ( set_flag && valid_flag )
<             {
<                 doSetValue(pp);
<             }
<
448a445
 >           // check validity
454,458d450
<
<                     if ( set_flag )
<                     {
<                         doSetValue(pp);
<                     }
465,468c457,462
<             else if ( set_flag )
<             {
<                 doSetValue(pp);
<             }
---
 >         }
 >
 >         // always set test value even if we don't validate
 >         if ( set_flag )
 >         {
 >             doSetValue(pp);


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>