Skip to content
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

Document that "empty_data" requires data in view format #6340

Closed
webmozart opened this issue Mar 9, 2016 · 4 comments
Closed

Document that "empty_data" requires data in view format #6340

webmozart opened this issue Mar 9, 2016 · 4 comments
Labels
actionable Clear and specific issues ready for anyone to take them. Form Keep open

Comments

@webmozart
Copy link
Contributor

It should be documented with the "empty_data" option that the data must be passed in view format, in case that differs from model format. For IntegerType, for example, "empty_data" must be set to a string value, not an integer (conversely to what you would intuitively expect):

$builder->add('number', IntegerType::class, [
    'empty_data' => '0', // not: 0
]);

See symfony/symfony#18047

@xabbuh xabbuh added actionable Clear and specific issues ready for anyone to take them. Form hasPR A Pull Request has already been submitted for this issue. labels Mar 10, 2016
@xabbuh
Copy link
Member

xabbuh commented Mar 11, 2016

@HeahDude kindly offered to take care of this together with his other changes in #6265.

@conradkleinespel
Copy link

Thanks @webmozart for taking the time to open this issue (I was just having this exact problem). And thanks @HeahDude for making a doc PR 😃

@xabbuh xabbuh removed the hasPR A Pull Request has already been submitted for this issue. label Sep 3, 2017
@carsonbot
Copy link
Collaborator

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@alexandre-daubois
Copy link
Member

It was fixed in https://github.com/symfony/symfony-docs/pull/7802/files, isn't it?

@xabbuh xabbuh closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. Form Keep open
Projects
None yet
Development

No branches or pull requests

5 participants