Bug #88829
closed
When looking at the Response
class: That one seems invalid to me.
https://github.com/TYPO3/TYPO3.CMS/blob/0c531014d09d0b16a92438c86d717a33e0a345b8/typo3/sysext/extbase/Classes/Mvc/Response.php
According to annotations, Response::__toString()
, Response::shutdown()
and Response::getContent()
are meant to return strings.
The object is intialized as what looks invalid to me because you end up having those method not returning strings. Especially (new Result())->__toString()
doesn't return a string but null.
Instead of casting the result of Response::shutdown()
, I'd suggest to initlaize the Result::$content = '';
propert as an empty string. I don't know if that crashes elsewhere, but from the looks of the description of Response
, that feels as the right move here.
- Category set to Extbase
- Status changed from New to Accepted
- Assignee set to Alexander Schnitzler
- Target version set to next-patchlevel
Stephan Schuler wrote:
When looking at the Response
class: That one seems invalid to me.
https://github.com/TYPO3/TYPO3.CMS/blob/0c531014d09d0b16a92438c86d717a33e0a345b8/typo3/sysext/extbase/Classes/Mvc/Response.php
According to annotations, Response::__toString()
, Response::shutdown()
and Response::getContent()
are meant to return strings.
The object is intialized as what looks invalid to me because you end up having those method not returning strings. Especially (new Result())->__toString()
doesn't return a string but null.
Instead of casting the result of Response::shutdown()
, I'd suggest to initlaize the Result::$content = '';
propert as an empty string. I don't know if that crashes elsewhere, but from the looks of the description of Response
, that feels as the right move here.
You describe the proper solution which I'd say is something for master and therefore for version 10.1.
In 10.0, we cannot trust the interface, therefore we should fulfil the contract of the return type of Bootstrap::handleRequest by casting the content to string.
- Status changed from Accepted to Under Review
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF