Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Form] minor fixes in ChoiceType options#13156
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
reference/forms/types/choice.rst Outdated
| return strtoupper($category->getName()); | ||
| // a property path can by used to define the options below | ||
| 'choice_value' => 'name', | ||
| // the empty value can be passed if there is a placeholder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't understand this comment either:
the empty value can be passed if there is a placeholderWe're describing thechoice_label option ... but we talk about "empty value" and "placeholder". I don't see the relation between all this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
When a placeholder is set among the choice list it is the empty value (null as a choice and empty string as value). When the placeholder is not explicitly defined but the field is not required the component adds it as first choice so we can select no choices (opposite of required).
So all callbacks should handle this case, I should better explain that in a dedicated caution I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes ... maybe a super short comment before the callback that accepts nullable types mentioning that you need that in case you use placeholders ...
... and then maybe a caution message with some more details like you explained in this comment. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I've pushed acaution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
For the recordsymfony/symfony#17787
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
OskarStark left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍🏻
41ac9c2 to4ee4102CompareOskarStark commentedFeb 18, 2020
Thank you Jules. |
Revival of#6393