8000 [2.7][Form] Fix default placeholder resolution if choice option required is false by HeahDude · Pull Request #14414 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[2.7][Form] Fix default placeholder resolution if choice option required is false #14414

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix default placeholder resolution if choice option required is false
  • Loading branch information
HeahDude committed Apr 19, 2015
commit b85082edb1517085e82e03d75a704c0934db149f
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function configureOptions(OptionsResolver $resolver)
};

$emptyValue = function (Options $options) {
return $options['required'] ? null : '';
return ($options['required'] && empty($options['choices'])) || !$options['required'] ? '' : null;
};

// for BC with the "empty_value" option
Expand Down
0