Project

General

Profile

Actions

Bug #81472

closed

Wrong exception is thrown in PageRepository

Added by Dmitry Dulepov almost 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-06-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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);
Actions

Also available in: Atom PDF