-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Form] Deprecate "read_only" option #10658
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
Hello @webmozart I want to start contribuiting in symfony, and i want to get some easy pick. I read the option read_only must be deprectated, but i don't know how to start in this issue. Can you give me some help or some ideas. Thanks for all. |
@Hades87 as you can see in the references above your comment, someone already opened a PR about this: #10676 So well, let's find a simple starter issue you can work on.......
If you have any questions, feel free to ask them in that particular issue, on IRC (#symfony), etc. Good luck coding! |
Thanks for your help @wouterj i take the issue and ask something in the correspondent thread. |
-read only still serves its purpose when disabled option is not applicable. I had this problem when a disabled field failed validation but still passes the containing form as valid. This was not the behavior in pre 2.5 api where even disabled field invalidates the form. Although I find this new behavior the expected one. but i agree that it should be an attr instead |
@webmozart Is there the posibility to have a field readonly / disabled with validation on the field but not altering the model data? A use case can be that only some have the permission to modify a field which is necessary to process but someone else is then processing the next step after this required field has been submitted. |
This PR was squashed before being merged into the 2.8 branch (closes #14403). Discussion ---------- [Form] deprecate read_only option | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #10658 | License | MIT | Doc PR | symfony/symfony-docs#3782 Replaces #10676 with a slightly different implementation. - fixes BC break when 'read_only' => true option and at the same time custom attributes are used by using a normalizer - adds deprecation notice - keeps legacy tests Commits ------- 53330e1 [Form] deprecate read_only option
The option "read_only" has no real functionality anymore and should be deprecated. The attribute can be set via the "attr" option instead.
See #10533 for details.
The text was updated successfully, but these errors were encountered: