Breaking: #92502 - Make Extbase handle PSR-7 responses only

See Issue #92502

Description

Extbase does no longer handle/return extbase responses whose api was defined by the interface TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface. Instead, Extbase does create a PSR-7 compatible response object (see Psr\\Http\\Message\\ResponseInterface) and passes it back through the request handling stack.

Since PSR-7 requires response objects to be immutable, it no longer makes sense to expose the response object to the user via TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController::$response and TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext->getResponse().

The following interfaces have been removed and are no longer usable:

  • TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface

The following classes have been removed and are no longer usable:

  • TYPO3\\CMS\\Extbase\\Mvc\\Response

Impact

Since interface TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface and TYPO3\\CMS\\Extbase\\Mvc\\Response have been removed, they can no longer be used.

Affected Installations

All installations that:

  • declared classes that implemented the interface TYPO3\\CMS\\Extbase\\Mvc\\ResponseInterface
  • instantiated or extended class TYPO3\\CMS\\Extbase\\Mvc\\Response
  • accessed the request object through TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ActionController::$response or TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext->getResponse()

Migration

To regain full control over the response object, a PSR-7 compatible response object SHOULD be created in the controller action and returned instead of returning a string or void.

Example:

public function listAction()
{
    // do your action stuff
    return new \TYPO3\CMS\Core\Http\HtmlResponse($this->view->render());
}

Further: Method TYPO3\\CMS\\Extbase\\Mvc\\Response::addAdditionalHeaderData() had been used to add additional header data such as css or js to the global TypoScriptFrontendController. This has to be done via TYPO3\\CMS\\Core\\Page\\AssetCollector now.