-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
TextType empty_data = null if string is empty #7596
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
Comments
The feature has been introduced in 3.1 in symfony/symfony#18357, but the target should now be 3.2. It would be easier to handle it once #6265 is merged. |
Why was this put on hold? More people are running into this, see symfony/symfony#22192 |
I have just encountered this bug. Is it a problem in the documentation or do you intent to change the behavior of the TextType? |
The behavior is now But it may be the opposite in 4.0, I'm working on it (no PR is open yet) but this is not as simple as it sounds :). |
…s more visisble (HeahDude, wouterj, javiereguiluz) This PR was merged into the 2.7 branch. Discussion ---------- [Form] Make difference between data and empty_data options more visisble Finishes #6265 Fixes #7299, #7596 Commits ------- 64e3984 Fixed a minor typo df9b878 Fixed a minor typo f375489 Better explain empty_data values d552ea3 Readd mixed type for empty_data, it can be string, array or object 188f0ab Tried to write the important points more explicitly 5f3813d Updated the example add added a caution 4fd2d96 Addressed @stof's comment 242941a improved accuracy 67c93b6 fix typo 87b3542 explicit differences between 'data' & 'empty_data' in FormType
We need to update the |
see also symfony/symfony#29061 for problems one runs into when reading the current description |
Fixed in #10743. Closing here, thanks for the report. |
Hello.
I am getting null value after passing empty string to symfony form field.
After defining empty_data in form builder, the problem has gone:
But documentation claims that empty_data is empty string ('') by default. So either the documentation should be changed or behavior of form field type.
Link to docs: http://symfony.com/doc/current/reference/forms/types/text.html#empty-data
Thanks.
The text was updated successfully, but these errors were encountered: