-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.7] [Form] Fix BC break by allowing 'choice_label' option to be 'false' in ChoiceType #17798
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
Ok tests are passing, failure seems not related. |
2346190
to
ab79ad5
Compare
👍 |
if (null === $label) { | ||
// If the labels are null, use the original choice key by default | ||
$label = (string) $key; | ||
} elseif (false !== $label) { |
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.
In order to document better what this code does, could you please add a comment here about the false
value? Something like:
// If "choice_label" is set to false and "expanded" is true, the value false
// should be passed on to the "label" option of the checkboxes/radio buttons
👍 apart from my comment |
When `ChoiceType`is expanded, `choice_label` option can be `false` or return `false` for one or more choices by a callable.
Fixed, rebased and squashed. ping @fabpot |
Sorry, rebased on 2.8. I'm fixing it. |
When `ChoiceType`is expanded, `choice_label` option can be `false` or return `false` for one or more choices by a callable.
Ok now just waiting for the green :) |
👍 Status: Reviewed |
Thank you @HeahDude. |
…n to be 'false' in ChoiceType (HeahDude) This PR was merged into the 2.7 branch. Discussion ---------- [2.7] [Form] Fix BC break by allowing 'choice_label' option to be 'false' in ChoiceType | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #17773 | License | MIT | Doc PR | symfony/symfony-docs#6282 - [x] Make tests pass - [x] Adress a doc PR - [x] Replace alias by FQCN in tests for 2.8, see #17890 - [x] Remove `choices_as_values` in tests for 3.0, see #17891 Commits ------- 017e1d9 bug #17798 [Form] allow `choice_label` option to be `false`
* 2.7: bug #17798 [Form] allow `choice_label` option to be `false`
* 3.0: #17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features #17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features Fix bug when using an private aliased factory service [Form] fix tests added by #17798 by removing `choices_as_values` [Form] fix FQCN in tests added by #17798 [DependencyInjection] Remove unused parameter of private property bug #17798 [Form] allow `choice_label` option to be `false` [Form] fix tests added by #17760 with FQCN ChoiceFormField of type "select" could be "disabled" Update contributing docs [Console] Fix escaping of trailing backslashes Fix constraint validator alias being required [DependencyInjection] Simplified code in AutowirePass [ci] clone with depth=1 to kill push-forced PRs Add check on If-Range header
…me (HeahDude) This PR was merged into the 2.7 branch. Discussion ---------- [From] minor fix tests added by #17798 for bootstrap theme | Q | A | ------------- | --- | Branch | 2.7+ | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | n/a | License | MIT | Doc PR | - Commits ------- ee5b119 [From] minor fix tests added by #17798 for bootstrap theme
* 2.7: [From] minor fix tests added by #17798 for bootstrap theme
* 2.8: fix debug toolbar rendering by removing inadvertently added links [Form] minor fix tests of Bootstrap layout [From] minor fix tests added by #17798 for bootstrap theme simplified code Allow variadic controller parameters to be resolved.
* 3.0: fix debug toolbar rendering by removing inadvertently added links [Form] minor fix tests of Bootstrap layout [From] minor fix tests added by #17798 for bootstrap theme simplified code Allow variadic controller parameters to be resolved.
This PR was merged into the 2.7 branch. Discussion ---------- [Form] fix `choice_label` values | Q | A | ------------- | --- | Doc fix? | yes | New docs? | kind of | Applies to | 2.7+ | Fixed tickets | n/a This PR is a complement of symfony/symfony#17798, which allows handling `false` as `choice_label` value in `ChoiceType` and its inheritance. Not sure about the phrasing but this is the idea, suggestions are welcome ! Commits ------- 73f1935 [Form] fix `choice_label` values
* 2.8: fix debug toolbar rendering by removing inadvertently added links [Form] minor fix tests of Bootstrap layout [From] minor fix tests added by symfony#17798 for bootstrap theme simplified code Allow variadic controller parameters to be resolved.
* 3.0: fix debug toolbar rendering by removing inadvertently added links [Form] minor fix tests of Bootstrap layout [From] minor fix tests added by symfony#17798 for bootstrap theme simplified code Allow variadic controller parameters to be resolved.
choices_as_values
in tests for 3.0, see [3.0] [Form] fix tests added by #17798 by removingchoices_as_values
#17891