Issue Bug Closed

#70037Obsolete construct Parameter in DatabaseQueryProcessor breaks Frontend

Sebastian Seidelmann 09/23/15, 12:22 updated 10/19/17, 21:47

Description

Hi everbody. The Problem is, that there is a missing argument for the __construct Method in TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor. Here are the two “fast” solutions:

- Add the Parameter to the makeInstance call in TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor (l 58) > GeneralUtility::makeInstance($className, $cObject). Not a nice solution, but its working :simple_smile:
Remove the Parameter from the TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::__construct. Obviously the Content Object Renderer instance isn’t used in the whole class, so it’s not needed. Furthermore the other Dataprocessors haven’t a __construct yet, so the target should be to implement the __construct in TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface, so there can’t be a failure with wrong API usage.

If the Content Object Renderer Instance is needed to a further step, just implement the parameter in every __construct Method in all of the content processors.

#1: PHP Catchable Fatal Error: Argument 1 passed to TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor::__construct() must be an instance of TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer, none given, called in /vagrant/typo3_src/typo3/sysext/core/Classes/Utility/GeneralUtility.php on line 4342 and defined in /vagrant/typo3_src/typo3/sysext/frontend/Classes/DataProcessing/DatabaseQueryProcessor.php line 56

Reviews 1