8000 JsonResponse fix by kanariezwart · Pull Request #16689 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Conversation

kanariezwart
Copy link
Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #16541
License MIT
Doc PR

Please also consider closed PR discussions:
#16551
#16563

Changed $this->data to an container for setting or adding scalar content to ResponseObject. $this->content is a string representation of $this->data.
$this->update() is an private function to sync $this->data and $this->content. When modifying either $data or $content or by setting encoding options, the two are synced.
Changed $this->update() to sync this->data and $this->content
Updated JsonResponse after feedback
@kanariezwart
Copy link
Author

@stof take three. Thank for the feedback. I think this attempt is a bit less intrusive.
@xabbuh please consider the rework of PR #16563

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are still breaking BC by storing the array/object/scalar instead of storing the JSON string.

And it might even break things in case your data is a mutable object, as your data could be mutated before you trigger another update

@fabpot
Copy link
Member
fabpot commented Jan 27, 2016

Closing as this breaks BC.

@fabpot fabpot closed this Jan 27, 2016
@kanariezwart kanariezwart deleted the jsonresponse-fix branch February 9, 2016 12:25
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.

3 participants

0