-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NumberFormatter fails to parse invalid numbers #14430
Comments
This works in an older version? Can you paste the complete stack trace? |
I don't know if this works in an older version. But I think it didn't work. |
I found that the problem is the |
If I change the error_level to 0, I don't have errors anymore. What I don't understand is why there is two level of validation. If I enter text in an integer field, the validation of type is done by the field. But if I chose to use a text field, the validation of type is done with the validator. |
The integer type is rendered as a input[type=number], which have a HTML5 validation by default. see http://symfony.com/doc/current/book/forms.html#form-validation for instructions for disable it. |
Thank you. I knew that but I didn't mentioned it since I am not using HTML5. |
You're welcome :) If you need help, you can make a question in the mailing list http://symfony.com/mailing_lists. Is this resolved? Can this be closed? |
I will close it but I am still confused. |
I was trying to validate my form entries using the Type validation with integer type and I get the following error:
This error does not occur all the time, only when the value to format does not start with a number. So 123dd will return an error but dd123 will fail.
For more information, you could have a look on my stackoverflow question
I am using Symfony 2.6.6. I checked the code for the parse method in the 2.7 and 2.8 branches and it appears to be the same as in branch 2.6.
Edit 1:
To answer a deleted comment about my ICU version, here is the output of the command
php -ri intl
Edit 2:
Here is the content of my log file:
The text was updated successfully, but these errors were encountered: