[FLOW3-general] Issues with Validation and Property Mapping
Sebastian Kurfürst
sebastian at typo3.org
Wed Apr 18 14:24:28 CEST 2012
Hey,
the type converter should handle the "empty" case specially by returning
NULL, such that the Validator works correctly (think of Not Empty f.e.)
> 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.
as said, the converter needs to return NULL.
See [1] for all possible return values of a type converter.
> 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.
Empty values have to be handled with special care; else you cannot enter
empty numbers at all ;-)
Would you take care of the patch?
Greets, Sebastian
[1]
http://flow3.typo3.org/documentation/guide/partiii/propertymapping.html#writing-own-typeconverters
More information about the FLOW3-general
mailing list