Skip to content

[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

Merged
merged 1 commit into from
Feb 28, 2016

Conversation

HeahDude
Copy link
Contributor

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

@HeahDude
Copy link
Contributor Author

Ok tests are passing, failure seems not related.

@HeahDude HeahDude force-pushed the fix-#17773 branch 2 times, most recently from 2346190 to ab79ad5 Compare February 16, 2016 23:22
HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 22, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 22, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 22, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 22, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 22, 2016
@HeahDude HeahDude changed the title [WIP] [2.7] [Form] Fix BC break by allowing 'choice_label' option to be 'false' in ChoiceType [2.7] [Form] Fix BC break by allowing 'choice_label' option to be 'false' in ChoiceType Feb 22, 2016
@fabpot
Copy link
Member

fabpot commented Feb 23, 2016

👍

if (null === $label) {
// If the labels are null, use the original choice key by default
$label = (string) $key;
} elseif (false !== $label) {
Copy link
Contributor

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

@webmozart
Copy link
Contributor

👍 apart from my comment

HeahDude added a commit to HeahDude/symfony that referenced this pull request Feb 26, 2016
When `ChoiceType`is expanded, `choice_label` option can be `false`
or return `false` for one or more choices by a callable.
@HeahDude
Copy link
Contributor Author

Fixed, rebased and squashed.

ping @fabpot

@HeahDude
Copy link
Contributor Author

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.
@HeahDude
Copy link
Contributor Author

Ok now just waiting for the green :)

@xabbuh xabbuh added the Form label Feb 27, 2016
@xabbuh
Copy link
Member

xabbuh commented Feb 27, 2016

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Feb 28, 2016

Thank you @HeahDude.

@fabpot fabpot merged commit 017e1d9 into symfony:2.7 Feb 28, 2016
fabpot added a commit that referenced this pull request Feb 28, 2016
…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`
fabpot added a commit that referenced this pull request Feb 28, 2016
* 2.7:
  bug #17798 [Form] allow `choice_label` option to be `false`
fabpot pushed a commit that referenced this pull request Feb 28, 2016
fabpot added a commit that referenced this pull request Feb 28, 2016
* 2.8:
  [Form] fix FQCN in tests added by #17798
  bug #17798 [Form] allow `choice_label` option to be `false`
  [DependencyInjection] Simplified code in AutowirePass
fabpot added a commit that referenced this pull request Feb 28, 2016
* 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
This was referenced Feb 28, 2016
HeahDude added a commit to HeahDude/symfony that referenced this pull request Mar 1, 2016
fabpot added a commit that referenced this pull request Mar 1, 2016
…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
fabpot added a commit that referenced this pull request Mar 1, 2016
* 2.7:
  [From] minor fix tests added by #17798 for bootstrap theme
fabpot added a commit that referenced this pull request Mar 1, 2016
* 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.
fabpot added a commit that referenced this pull request Mar 1, 2016
* 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.
weaverryan added a commit to symfony/symfony-docs that referenced this pull request Mar 6, 2016
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
@HeahDude HeahDude deleted the fix-#17773 branch March 24, 2016 23:41
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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.
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants