Bug #86370
closedMissing content-type header in JsonView
0%
Description
Currently the render function of TYPO3\CMS\Extbase\Mvc\View\JsonView
tries to use tsfe to send the Content-type Header, but as this is later never evaluated, the Header gets completely lost.
This bug is visible, if you try to create a new form inside the new form extension. If you create a form, you just get the notification
The form could not be saved: undefined
because the Response is treated as plain text instead of a json object.
To solve this, a simple solution would be to replace the following line inside the render function
$typoScriptFrontendController->setContentType('application/json')
with this
$response->setHeader('Content-Type', 'application/json');
but I'm not sure if this is the best way. Maybe the tsfe call is important and one should fix the wrapping if condition.
Updated by Josef Glatz about 6 years ago
- Status changed from New to Needs Feedback
Thanks four your issue. I can't reproduce this in a plain 9-master and 8_7-master.¶
Could you add some more details about your environment?
What I've tested so far (Master 9.5 + Master 8.7)¶
- Log in as TYPO3 backend admin
- Opened ext:Form backend modul
- Created a new form (simple and advanced mode)
- Both forms were successfully created
Updated by Georg Ringer about 6 years ago
- Status changed from Needs Feedback to Closed
closed as lack of feedback.