The clean values are only available from the main form object. The 
embedded forms are not bound and do not validate the values directly. 
Everything is done by the main form.

Fabien

--
Fabien Potencier
Sensio CEO - symfony lead developer
sensiolabs.com | symfony-project.com | aide-de-camp.org
Tél: +33 1 40 99 80 80


David Herrmann wrote:
> I've stumbled upon a very interesting problem using symfony 1.2 embedded 
> forms.
> 
> I'm using a propel form that embeds some more propel forms which contain 
> some more or less complex widgets.
> 
> Binding and validation works fine, but the values I get afterwards using 
> ->getValues() on the parent form are not cleaned. There's for example a 
> time widget with hour and minute inputs using sfValidatorTime and the 
> cleaned value contains the hour and minute array instead of the single 
> time value.
> 
> The widgets work fine if used in a non-embedded form, so I suppose 
> there's a problem somewhere inside the embedding of validators.
> 
> Tracking down the generated values during validation I found out the 
> following:
> 
> ValidatorSchema.class.php, Line 193:
>    return $clean;
> The values are fine here, e.g. the time is a single string value.
> 
> sfForm.class.php, Line 226:
>    $this->values = 
> $this->validatorSchema->clean(self::deepArrayUnion($this->taintedValues, 
> self::convertFileInformation($this->taintedFiles)));
> After this line the values that were just fine inside the 
> ValidatorSchema are not clean any more. So it seems like the "dirty" 
> values somehow manage to slip through.
> 
> I couldn't find out what happens in between line 226 in sfForm and the 
> cleaning, but the problem must reside somewhere in between when the 
> ValidatorSchema includes embedded validators.
> 
> System information: Vista x64, PHP 5.2.6, Apache 2 handler (xampp)
> 
> Please take a look at this and tell me if you need more detailed 
> information to fix this. I love the new embedded forms system, it really 
> works great up until the cleaning.
> 
> David
> 
> > 
> 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to