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

Fix setValue on checkbox and select fields if they are multiple #526

Conversation

robertfausk
Copy link
Contributor

Currently ChoiceFormField::setValue is only able to add new values if the field is select or choice.

This only-adding behavior:

  • prevents the user from deselecting a value.
  • prevents the user from
  • is not conform with ChoiceFormField::setValue of symfony-dom-crawler which resets the value of the field by the given value.

This PR unsets all previous values from given field before the given value is set.

PS: Do I have do take any action to get this PR into the main branch? 🙃

Copy link
Member

@dunglas dunglas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dunglas dunglas merged commit 23c920d into symfony:1.x Jan 4, 2022
@dunglas
Copy link
Member

dunglas commented Jan 4, 2022

Thanks Robert!

@robertfausk robertfausk deleted the fix_setValue_on_checkbox_and_select_fields_if_multiple branch March 31, 2022 05:18
@robertfausk
Copy link
Contributor Author

@dunglas I just realized that this PR is not upstream merged into the main branch. By now it is only available in 1.x
Shall I open a new PR for this or will you take it into account?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants