Skip to content
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

[10.x] Retain $request->request InputBag type #47838

Merged
merged 2 commits into from Jul 26, 2023

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Jul 26, 2023

When we create the Illuminate request, we set the $request->request property to the value of the $request->json property.

Symfony is expecting $request->request to be an InputBag when invoking $request->getPayload(). See:

https://github.com/symfony/symfony/blob/42d9d7cd64c5b9897a2113c12d76c75a8d31ad9c/src/Symfony/Component/HttpFoundation/Request.php#L1514

The $request->json property is an instance of ParameterBag. This is the parent class of InputBag.

So we are setting $request->request to an instance of ParameterBag instead of InputBag which is then breaking due to the return type on Request::getPayload()

Side note

It is possible that we should make $request->json an instance of InputBag to make things consistent, however this is a quick fix to fix the framework asap.

fixes #47834

@LukeTowers
Copy link
Contributor

Can this get back-ported to the 9.x branch as well?

@timacdonald
Copy link
Member Author

See: #47840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request::getPayload(): Return value must be of type InputBag, ParameterBag returned
3 participants