[TASK] Work on compatibility for TYPO3 11

This commit is contained in:
Philipp Dieter 2024-12-02 18:44:51 +01:00
parent 786c200609
commit d66fdf29a1

View File

@ -805,7 +805,12 @@ class ActionController extends BaseController
if ($this->reload) { if ($this->reload) {
$result['reload'] = true; $result['reload'] = true;
} }
return json_encode($result); if (version_compare(TYPO3_branch, '10.0', '>=')) {
$response->getBody()->write(json_encode($result));
return $response;
} else {
return json_encode($result);
}
} }
$result = array_merge( $result = array_merge(
$result, $result,
@ -820,5 +825,12 @@ class ActionController extends BaseController
); );
} }
$this->view->assignMultiple($result); $this->view->assignMultiple($result);
return $this
->responseFactory
->createResponse()
->withHeader('Content-Type', 'text/html; charset=utf-8')
->withBody($this->streamFactory->createStream(
(string)($html ?? $this->view->render()))
);
} }
} }