-
Notifications
You must be signed in to change notification settings - Fork 155
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
Fix Symfony 6 Exception #507
Conversation
mpysiak
commented
Nov 29, 2022
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Related tickets | fixes #506 |
License | MIT |
@@ -60,7 +60,7 @@ public function handleRequest(FormInterface $form, mixed $request = null): void | |||
return; | |||
} | |||
|
|||
$data = $request->query->get($name); | |||
$data = $request->query->all()[$name]; |
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.
$data = $request->query->all()[$name]; | |
$data = $request->query->all($name); |
Cosmetic change 😅
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.
@mpysiak note for the future, please either apply suggestions from the comment or answer why you don't want to do so. Please, don't just mark a comment as resolved without anything in it
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.
@lchrusciel sorry, it was my first 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.
@lchrusciel, it looks like this "cosmetic change" breaks in SF 5.4. Although it works in SF6. It produces an error
Unexpected value for parameter "xxx": expecting "array", got "string"
It works fine if I revert back to
$data = $request->query->all()[$name];
Co-authored-by: Jakub Tobiasz <80641364+jakubtobiasz@users.noreply.github.com>
Hey MIchał, thank you very much for the PR! 🎉 And welcome among other Sylius contributors! :) |
…nseMate) This PR was merged into the 1.10 branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | fixes #876, followup of #507 | License | MIT Keeping the way we access the parameters bag the same way it's done in the base class. Refs: - https://github.com/symfony/form/blob/5.4/Extension/HttpFoundation/HttpFoundationRequestHandler.php - https://github.com/symfony/form/blob/6.4/Extension/HttpFoundation/HttpFoundationRequestHandler.php Commits ------- cedee23 Fix form parameter bags accesing in request handler