[FLOW3-general] Issues with Validation and Property Mapping

Adrian Föder adrian at foeder.de
Wed Apr 18 11:17:48 CEST 2012


ah, and I noticed an additional issue:
Remember (that's only for me to remember ;-) the order:
   - Property Mapping (with implicit/explicit type conv)
   - Validation of mapped / converted values

The e.g. FloatConverter from Bastian's test checks, besides others, for

strlen($source) > 0

So if the source, as string, is *empty*, that converter doesn't throw 
the Error. That means, and empty string passes that check, is casted to 
(float), which results in becoming 0.

I would ask to suggest if the strlen() check shouldn't just been thrown 
out, because if it is acutally an empty string, it's indeed also not a 
float and should result in that error.

Greets,
adrian



Am 18.04.2012 05:34, schrieb Sebastian Kurfürst:
> Hey Adrian,
>
> the process is as follows:
>
> - property mapping kicks in first, with type conversion
> - then follows validation
>
> So generally Bastian's patch is great... In your case, however, it also
> fails IIRC, because isNumeric is buggy there... No?
>
> How you could fix this for your application is writing a separate string
> to float type converter with a higher priority than the default one; and
> implement the very restrictive checking for yourself.
>
>
> Greets, Sebastian
>



More information about the FLOW3-general mailing list