Bug #81472
closedWrong exception is thrown in PageRepository
100%
Description
If PsgeRepository's init hook is of the wrong class, an exception should be thrown with a corresponding message. However there is an error that prevents an exception from being thrown. Instead a PHP fatal error is thrown.
The problem is that $hookObject
is used instead of $classRef
when generating the exception.
Uncaught TYPO3 Exception #1: PHP Catchable Fatal Error: Object of class Vendor\Extension\Hooks\PageRepositoryFilter could not be converted to string in /home/***/vendor/typo3/cms/typo3/sysext/frontend/Classes/Page/PageRepository.php line 200 (More information) TYPO3\CMS\Core\Error\Exception thrown in file /home/***/vendor/typo3/cms/typo3/sysext/core/Classes/Error/ErrorHandler.php in line 111. 13 TYPO3\CMS\Core\Error\ErrorHandler::handleError(4096, "Object of class Vendor\Extension\Hooks\PageRepositoryFilter could not be converted to string", "/home/***/vendor/typo3/cms/typo3/sysext/frontend/Classes/Page/PageRepository.php", 200, array) /home/***/vendor/typo3/cms/typo3/sysext/frontend/Classes/Page/PageRepository.php: 00198: $hookObject = GeneralUtility::makeInstance($classRef); 00199: if (!$hookObject instanceof PageRepositoryInitHookInterface) { 00200: throw new \UnexpectedValueException($hookObject . ' must implement interface ' . PageRepositoryInitHookInterface::class, 1379579812); 00201: } 00202: $hookObject->init_postProcess($this);
Updated by Gerrit Code Review over 7 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53122
Updated by Gerrit Code Review over 7 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53122
Updated by Gerrit Code Review over 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53126
Updated by Wouter Wolters over 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 059a9583e13c007dc18f3af531e98e64bfdea237.