[10.x] Migrate JSON data to shared InputBag #47914
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #47877
We recently made a change to how the JSON input was handled due to a change in Symfony.
With the change, we created a new
InputBaginstance for therequestdata and left thejsondata in the originalParameterBag.This meant that when data was merged into the request, via
request()->merge(), it was not shared with therequestInputBag.This PR migrates the
jsoninput to anInputBagas well and then uses thatInputBaginstance as therequestdata when creating a new Request instance.Request merge now works as it previously did, but with the caveat that all data within the
jsonpayload must be a scalar type. Object in JSON are decoded as associative arrays.This does bring consistency across all input types, so I feel this is probably the best approach anyway.