8000 Add note about changed form processing when using PUT requests · fnagel/symfony@c6bb561 · GitHub
[go: up one dir, main page]

Skip to content

Commit c6bb561

Browse files
committed
Add note about changed form processing when using PUT requests
See symfony#8261
1 parent 5478a9d commit c6bb561

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

UPGRADE-3.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,24 @@ UPGRADE FROM 2.x to 3.0
511511
}
512512
}
513513
```
514+
515+
If you're using `PUT` requests you need to pass the request method to the form:
516+
517+
Before:
518+
519+
```php
520+
$form = $this->createForm(FormType::class, $entity);
521+
$form->submit($request);
522+
```
523+
524+
After:
525+
526+
```php
527+
$form = $this->createForm(FormType::class, $entity, [
528+
'method' => $request->getMethod(),
529+
]);
530+
$form->handleRequest($request);
531+
```
514532

515533
* The events `PRE_BIND`, `BIND` and `POST_BIND` were renamed to `PRE_SUBMIT`, `SUBMIT`
516534
and `POST_SUBMIT`.

0 commit comments

Comments
 (0)
0