Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Form]renderForm() method is deprecated#16948
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| {# form is a variable passed from the controller via either | ||
| $this->renderForm('...', ['form' => $form]) | ||
| $this->render('...', ['form' => $form]) | ||
| or $this->render('...', ['form' => $form->createView()]) #} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This line unfortunately won't work the samesymfony/symfony#46854 (comment). We need to be careful.
I propose to keep this PR open until I (or anyone) try to tackle this in core.
mdoutreluingneJul 7, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yes, I created this PR because currently in 6.2 therenderForm method is obsolete (so the documentation is acutely wrong). This branch is still under development and can therefore indeed be further modified. If you modify this method, don't forget to ping me so that I can close this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Note that both methods also weren't doing the same thing before this change. So I don't see this change blocking this PR.
forms.rst Outdated
| In versions prior to Symfony 5.3, controllers used the method | ||
| ``$this->render('...', ['form' => $form->createView()])`` to render the form. | ||
| The ``renderForm()`` method abstracts this logic and it also sets the 422 HTTP | ||
| The ``render()`` method abstracts this logic and it also sets the 422 HTTP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It may not (see my comment above).
HeahDude commentedJul 7, 2022
Thank you@mdoutreluingne for that PR. |
javiereguiluz commentedJul 22, 2022
Just checking: are we still waiting for some code changes before finishing this PR? Thanks! |
HeahDude commentedJul 22, 2022
Yes, I'll ping when there will be an update :). |
HeahDude commentedSep 16, 2022
Minor update: I've openedsymfony/symfony#47600, let's see how it goes. |
a8a24f6 to0c39fafComparewouterj commentedSep 20, 2022
Thanks@mdoutreluingne for writing up the documentation for this change! I've added some changes to your commit, to be more clear about the current situation and the differences between passing |
Fixes#16942