symfony/symfony — Issue #2389: Problem with form validator for numeric and integer type
Author: Isarien
Created: 2011-10-13 07:23:59+00:00
State: open

I discover 2 issues in form framework for the validator for numeric and integer fields. In my form, i have 1 field with interger type and another with numeric type.

When I bind the value 'Abc' for the numeric field, I had an exception : in the transform() method :

[2011-10-12 15:41:13] request.CRITICAL: Symfony\Component\Form\Exception\UnexpectedTypeException: Expected argument of type "numeric", "boolean" given (uncaught exception) at C:\wamp\www\menu\vendor\symfony\src\Symfony\Component\Form\Extension\Core\DataTransformer\NumberToLocalizedStringTransformer.php line 73 [] []

So I can't perform the isValid() Method.

When I bind the value 'Abc' for the integer field, I don't had an exception, but the string is converted to 0. So when I perform the isValid() method, the form is valid.