Skip to content
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

[Form] group_by as callback returns array #30429

Merged
merged 1 commit into from Apr 7, 2019

Conversation

antonch1989
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #30315
License MIT
Doc PR symfony/symfony-docs#...

@sstok
Copy link
Contributor

sstok commented Mar 3, 2019

IIRC the form uses the choice value (in the view) to determine which option was selected, if multiple options share the same value it's no longer possible to safely determine which option (in which group) was selected, and the first matching option is selected.

I might be wrong here, but you can verify (without to much hassle) if this works as expected by running an actual form in the web browser, and checking if the correct choice is marked as selected.

Thanks for working on this 👍

@nicolas-grekas nicolas-grekas added this to the next milestone Mar 4, 2019
@antonch1989
Copy link
Contributor Author

@sstok correct, there is no way to determine which exact choice was picked
abc123
The last one is active, when I create a builder like this $builder = $this->createFormBuilder(['country' => 'DE'])

@fabpot fabpot force-pushed the issue-30315-form-group-by branch from 4a31587 to 4c04601 Compare April 7, 2019 08:22
@fabpot
Copy link
Member

fabpot commented Apr 7, 2019

Thank you @antonch1989.

@fabpot fabpot merged commit 4c04601 into symfony:master Apr 7, 2019
fabpot added a commit that referenced this pull request Apr 7, 2019
This PR was squashed before being merged into the 4.3-dev branch (closes #30429).

Discussion
----------

[Form]  group_by as callback returns array

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30315
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Commits
-------

4c04601 [Form]  group_by as callback returns array
@antonch1989 antonch1989 deleted the issue-30315-form-group-by branch April 7, 2019 14:00
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.3 Apr 30, 2019
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request May 3, 2019
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #11516).

Discussion
----------

remove invalid array type

This is not true before Symfony 4.3 (spotted while looking into how to document symfony/symfony#30429).

Commits
-------

4be9672 remove invalid array type
@fabpot fabpot mentioned this pull request May 9, 2019
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.

None yet

7 participants