-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Fixed behavior of empty value if already defined #3864
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
Conversation
public function valuesContains($searchValue) | ||
{ | ||
foreach ($this->values as $value) | ||
{ |
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.
This should be in same line as foreach
Fixed, thanks @stloyd |
* | ||
* @return boolean | ||
*/ | ||
function valuesContains($searchValue); |
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.
wrong English. valuesContain
would be correct but is not really nice anyway.
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.
@Tobion Do you have better naming suggestion? Otherwise I'll correct the english :)
@bschussek: Ping? |
@fspillner Thank you for the PR! The implementation is not correct though. You are checking whether the values contain the contents of the "empty_value" option, but this option contains the label of the empty value I fixed this issue in the referenced PR #4801. |
Commits ------- 040ba8f [Form] Fixed: ChoiceType omits the "empty_value" option if the choices contain an empty element Discussion ---------- [Form] Fixed: ChoiceType omits the "empty_value" option if the choices contain an empty element Bug fix: yes Feature addition: no Backwards compatibility break: no Symfony2 tests pass: yes Fixes the following tickets: #3854, #3864 Todo: -
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3854
Todo: -