Project

General

Profile

Actions

Bug #86370

closed

Missing content-type header in JsonView

Added by Philipp Serrer about 6 years ago. Updated about 6 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 #1

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)

  1. Log in as TYPO3 backend admin
  2. Opened ext:Form backend modul
  3. Created a new form (simple and advanced mode)
  4. Both forms were successfully created
Actions #2

Updated by Josef Glatz about 6 years ago

  • Category set to Form Framework
Actions #3

Updated by Georg Ringer about 6 years ago

  • Status changed from Needs Feedback to Closed

closed as lack of feedback.

Actions

Also available in: Atom PDF