-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Deprecate "choices_as_values" => false #14951
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
Comments
See #14825 for more discussion on the motivation behind deprecating the option. |
Well, to continue here, I would 👎 for this. To resume why, just read @xabbuh say:
|
@soullivaneuh |
@stof He is talking about |
@webmozart Is this something you think we still need to consider for 2.8? |
…webmozart) This PR was submitted for the 2.7 branch but it was merged into the 2.8 branch instead (closes #16681). Discussion ---------- [Form] Deprecated setting "choices_as_values" to "false" | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14951 | License | MIT | Doc PR | - This PR does two important things that were forgot in the 2.7 branch: * The value `false` of the `choices_as_values` option was deprecated, but the deprecation error was missing. This error was added now. The option should be set to `true`, the entries of the corresponding `choices` option should be flipped. In 2.8, the `choices_as_values` option will be deprecated entirely. * When setting `choices_as_values` to `true`, the generated HTML values of choices always fell back to `0`, `1`, …, even when the choices can be converted to duplicate-free strings. This is fixed now: The HTML values now equal the string cast of the choices whenever possible to match the <2.7 behavior. Commits ------- 5d7678e [Form] Deprecated setting "choices_as_values" to "false"
The value
false
for the "choices_as_values" option (= the current default value) should be deprecated in 2.8. This means that people need to manually set the option totrue
for all choice fields.In Symfony 3.0, we can remove the code for handling the value
false
and deprecate the "choices_as_values" option altogether. In a future 3.x release, the option can be removed to complete the transition.The text was updated successfully, but these errors were encountered: