8000 minor #27560 Add note about changed form processing when using PUT re… · symfony/symfony@b9da7a6 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b9da7a6

Browse files
committed
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 #8261 Commits ------- 140b6c2 Add note about changed form processing when using PUT requests
2 parents abe49ef + 140b6c2 commit b9da7a6

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
@@ -595,6 +595,24 @@ UPGRADE FROM 2.x to 3.0
595595
}
596596
}
597597
```
598+
599+
If the form is submitted with a different request method than `POST`, you need to configure this in the form:
600+
601+
Before:
602+
603+
```php
604+
$form = $this->createForm(FormType::class, $entity);
605+
$form->submit($request);
606+
```
607+
608+
After:
609+
610+
```php
611+
$form = $this->createForm(FormType::class, $entity, [
612+
'method' => 'PUT',
613+
]);
614+
$form->handleRequest($request);
615+
```
598616

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

0 commit comments

Comments
 (0)
0