Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Form] Keep preferred_choices order for choice groups#34083
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bf793b2 to97ed3bfCompare
nicolas-grekas left a comment
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.
(with minor CS comment)
src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
d33285a to0572b1dCompared31120d to8afaaffCompare
HeahDude left a comment
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.
LGTM
src/Symfony/Component/Form/ChoiceList/Factory/DefaultChoiceListFactory.phpShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
8afaaff to75404e5Comparenicolas-grekas commentedNov 28, 2019
Thank you@vilius-g. |
…ius-g)This PR was squashed before being merged into the 4.3 branch.Discussion----------[Form] Keep preferred_choices order for choice groups| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets || License | MIT| Doc PR |Since 4.3 ordering of `preferred_choices` is preserved when displaying form. But this only works for flat options. When the choices are grouped, the preferred groups are in default order.Now the preferred choice group order is derived by taking the first matching choice from `preferred_choices` and using its position to sort the groups.Commits-------75404e5 [Form] Keep preferred_choices order for choice groups
Since 4.3 ordering of
preferred_choicesis preserved when displaying form. But this only works for flat options. When the choices are grouped, the preferred groups are in default order.Now the preferred choice group order is derived by taking the first matching choice from
preferred_choicesand using its position to sort the groups.