Project

General

Profile

Actions

Bug #81472

closed

Wrong exception is thrown in PageRepository

Added by Dmitry Dulepov over 7 years ago. Updated about 6 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 #1

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

Actions #2

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

Actions #3

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

Actions #4

Updated by Wouter Wolters over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #5

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF