Task #85011

BUGFIX: PHP 7.1 Reflection error for default value

Added by Forger Service over 1 year ago. Updated 12 months ago.

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

100%

TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

In PHP 7.1 under some circumstances the exception is not caught
as expected.
Therefore we use a check, as already done in ReflectionService.php
This issue was automatically created from https://github.com/TYPO3/TYPO3.CMS/pull/108

Associated revisions

Revision f7ea1c51 (diff)
Added by Daniel Siepmann over 1 year ago

[BUGFIX] PHP 7 Reflection error for default value

In PHP 7, under some circumstances the exception is not caught
as expected.
Therefore we use a check (as already done in ReflectionService.php).

Releases: 8.7, 7.6
Resolves: #85011
Change-Id: I41d58c3dbb508a7b17b4534ebd1c5ca79914af94
Reviewed-on: https://review.typo3.org/57092
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Mona Muzaffar <>
Tested-by: Mona Muzaffar <>
Reviewed-by: Jan Helke <>
Tested-by: Jan Helke <>

Revision 0c0c2409 (diff)
Added by Daniel Siepmann over 1 year ago

[BUGFIX] PHP 7 Reflection error for default value

In PHP 7, under some circumstances the exception is not caught
as expected.
Therefore we use a check (as already done in ReflectionService.php).

Releases: 8.7, 7.6
Resolves: #85011
Change-Id: I41d58c3dbb508a7b17b4534ebd1c5ca79914af94
Reviewed-on: https://review.typo3.org/56972
Tested-by: TYPO3com <>
Reviewed-by: Daniel Siepmann <>
Tested-by: Daniel Siepmann <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Mona Muzaffar <>
Tested-by: Mona Muzaffar <>
Reviewed-by: Jan Helke <>
Tested-by: Jan Helke <>

History

#1 Updated by Gerrit Code Review over 1 year 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/56969

#2 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56972

#3 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56972

#4 Updated by Mathias Brodala over 1 year ago

  • TYPO3 Version changed from 8 to 7

#5 Updated by Daniel Siepmann over 1 year ago

The error exists with TYPO3 CMS 7.6.27 + PHP 7.0.30-1+ubuntu18.04.1+deb.sury.org+1, 7.1.17-1+ubuntu18.04.1+deb.sury.org+1, 7.2.5-1+ubuntu18.04.1+deb.sury.org+1.
Could not reproduce the error with TYPO3 CMS 8.7.13 in any of the above PHP versions.

The issue is raised by one of the following:

- TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode::__construct argument text
- TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::__construct argument objectPath
- TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ArrayNode::__construct argument internalArray

Looks like none of these are reflected anymore in CMS 8.

#6 Updated by Saskia Schreiber over 1 year ago

I can confirm this issue, in my case it occured with TYPO3 8.7.12 and PHP 7.

Error:

Warning: Uncaught ReflectionException: Internal error: Failed to retrieve the default value in /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php:70 Stack trace: #0 /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php(70): ReflectionParameter->getDefaultValue() #1 /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php(39): TYPO3\CMS\Extbase\Object\Container\ClassInfoFactory->getConstructorArguments(Object(ReflectionClass)) #2 /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/Container.php(347): TYPO3\CMS\Extbase\Object\Container\ClassInfoFactory->buildClassInfoFromClassName('SJBR\\StaticInfo...') #3 /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/Container.php(173): TYPO3\CMS\Extbase\Object\Container\Container->getClassInfo('SJBR\\StaticInfo...') #4 /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/Container.php(228): TYPO3\CMS\Extba in /var/www/vendor/typo3/cms/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php on line 70

The reflected class was SJBR\StaticInfoTables\Domain\Repository\TerritoryRepository, I am using the SelectViewHelper provided by the extension (https://github.com/TYPO3-extensions/static_info_tables/blob/master/Classes/ViewHelpers/Form/SelectViewHelper.php) which tries to load the repository via injection.

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56972

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/56972

#9 Updated by Gerrit Code Review over 1 year 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/57092

#10 Updated by Anonymous over 1 year ago

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

#11 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF