minor #27560 Add note about changed form processing when using PUT requests (fnagel)
This PR was merged into the 2.8 branch.
Discussion
----------
Add note about changed form processing when using PUT requests
| Q | A
| ------------- | ---
| Branch? | 2.8 and up?
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| License | MIT
Added a note about changed form processing when using PUT requests as people still struggling with this change. Documenting it should help people to quickly fix this without struggling why some of their forms won't work any more after upgrading.
See https://github.com/symfony/symfony/issues/8261
Commits
-------
140b6c2101
Add note about changed form processing when using PUT requests
This commit is contained in:
commit
b9da7a6fd6
@ -596,6 +596,24 @@ UPGRADE FROM 2.x to 3.0
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If the form is submitted with a different request method than `POST`, you need to configure this in the form:
|
||||||
|
|
||||||
|
Before:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$form = $this->createForm(FormType::class, $entity);
|
||||||
|
$form->submit($request);
|
||||||
|
```
|
||||||
|
|
||||||
|
After:
|
||||||
|
|
||||||
|
```php
|
||||||
|
$form = $this->createForm(FormType::class, $entity, [
|
||||||
|
'method' => 'PUT',
|
||||||
|
]);
|
||||||
|
$form->handleRequest($request);
|
||||||
|
```
|
||||||
|
|
||||||
* The events `PRE_BIND`, `BIND` and `POST_BIND` were renamed to `PRE_SUBMIT`, `SUBMIT`
|
* The events `PRE_BIND`, `BIND` and `POST_BIND` were renamed to `PRE_SUBMIT`, `SUBMIT`
|
||||||
and `POST_SUBMIT`.
|
and `POST_SUBMIT`.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user