Skip to content

Conversation

@yann-eugone
Copy link
Collaborator

When enum values are objects, the submitted data is the position of the value in the "choices" option.
It works but do not seems to be a good default value:

  • when working on a "MyCLabs enum", we want to submit the enum value
  • when working on a "PHP native enum", we want to submit the enum case name
  • when working on a "PHP native backed enum", we want to submit the enum case value

In order to avoid BC, the "enum_choice_value" option is introduced, and a deprecations is raised when it is not configured explicitely (forcing developer to think about the desired behavior).
But in the 5.x, the default behavior will be inverted, and the option will be true by default.

@yann-eugone yann-eugone requested a review from J-Ben87 August 18, 2023 13:33
Copy link
Contributor

@J-Ben87 J-Ben87 left a comment

Choose a reason for hiding this comment

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

This might require a bit of documentation 🙂

@yann-eugone yann-eugone merged commit 323c155 into 4.x Aug 18, 2023
@yann-eugone yann-eugone deleted the enum-form-submit-value branch July 8, 2024 13:40
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.

3 participants