Skip to content
Snippets Groups Projects
Commit 0943a9c5 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[TASK] Add convenience method for extbase JSON responses

Since #92784 extbase actions require to return a PSR-7 Response.
To ease the migration path, the convenience method htmlResponse()
was added. This method creates a new PSR-7 Response with the correct
header and status code. Furthermore, in case no $html content is
given explicitly, the current view is rendered and the result
passed as response body.

Extbase however also features the JsonView, which is widely
used in third-party extensions as well as in multiple core
controllers itself. Also TSFE has to be respected when adding
the content-type header with the correct charset. Therefore,
a new method jsonResponse(), with similar functionality to
htmlResponse(), is now added along with adaptations of all
places in core controllers.

Resolves: #94440
Related: #92784
Releases: master
Change-Id: Ic591a8788f586050578db8b4187e29325d180f49
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69664


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
parent 92999a6e
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment