Project

General

Profile

Actions

Bug #86370

closed

Missing content-type header in JsonView

Added by Philipp Serrer over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2018-09-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

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.

Actions

Also available in: Atom PDF