Skip to content

[Form] Use duplicate_preferred_choices to set value of ChoiceType #60054

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
Mar 28, 2025

Conversation

aleho
Copy link
Contributor

@aleho aleho commented Mar 26, 2025

When the preferred choices are not duplicated an option has to be selected in the group of preferred choices.

Closes #58561

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #58561
License MIT

When the preferred choices are not duplicated an option has to be selected in the group of preferred choices.

@carsonbot
Copy link

Hey!

Thanks for your PR. You are targeting branch "7.3" but it seems your PR description refers to branch "6.4".
Could you update the PR description or change target branch? This helps core maintainers a lot.

Cheers!

Carsonbot

@aleho aleho changed the base branch from 7.3 to 6.4 March 26, 2025 16:42
@aleho
Copy link
Contributor Author

aleho commented Mar 26, 2025

Thank you, @carsonbot

@stof
Copy link
Member

stof commented Mar 26, 2025

it would be great to add a test covering this case (we have tests for the rendering of forms)

When the preferred choices are not duplicated an option has to be
selected in the group of preferred choices.

Closes symfony#58561
@aleho
Copy link
Contributor Author

aleho commented Mar 27, 2025

@stof I added tests for both cases, with duplication on and off, to make sure my changes don't break anything.

@fabpot fabpot modified the milestones: 7.3, 6.4 Mar 28, 2025
@fabpot
Copy link
Member

fabpot commented Mar 28, 2025

Thank you @aleho.

@fabpot fabpot merged commit 5a0d245 into symfony:6.4 Mar 28, 2025
9 of 11 checks passed
@stof
Copy link
Member

stof commented Mar 28, 2025

To fix the low-deps job in the CI, you need to update the min version of symfony/form in the require-dev of the twig-bridge (the high-deps will be fixed when merging up)

This was referenced Mar 28, 2025
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.

duplicate_preferred_choices => false - won't populate form option value on edit
4 participants