Bug #89830

Avoid resolving default value of static property in ClassSchema

Added by Oliver Hader 5 days ago. Updated 5 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2019-12-03
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

( ! ) Fatal error: Uncaught PDOException: You cannot serialize or unserialize PDO instances in /Users/olly/Development/typo3/master/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php on line 59
( ! ) PDOException: You cannot serialize or unserialize PDO instances in /Users/olly/Development/typo3/master/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php on line 59

#    Time    Memory    Function    Location
1    6.9564    33279256    TYPO3\CMS\Extbase\Reflection\ReflectionService->__destruct( )    .../ReflectionService.php:0
2    6.9564    33279256    TYPO3\CMS\Core\Cache\Frontend\VariableFrontend->set( )    .../ReflectionService.php:81
3    6.9565    33279256    serialize ( )    .../VariableFrontend.php:59
4    6.9578    33805968    __sleep ( )    .../VariableFrontend.php:59

This happens, when e.g. calling new felogin password reset controller using PDO database driver (which just triggers this problem).

Associated revisions

Revision 54d10b16 (diff)
Added by Oliver Hader 5 days ago

[BUGFIX] Avoid resolving default values of static property in ClassSchema

Building reflection cache in ClassSchema on static class properties will
lead to side-effects. For instance when ConnectionPool is analyzed for
being used with Extbase dependency injection and has been used already
during runtime - which is very likely - static property $connections is
going to hold all runtime connections.

https://www.php.net/manual/en/reflectionclass.getdefaultproperties.php:

This method only works for static properties when used on internal
classes. The default value of a static class property can not be
tracked when using this method on user defined classes.

That's why default values of static properties are not resolved anymore.

Resolves: #89830
Releases: master
Change-Id: I0040c3e4327d084b3192017874154ab5d8466508
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62518
Tested-by: TYPO3com <>
Tested-by: Alexander Schnitzler <>
Tested-by: Susanne Moog <>
Reviewed-by: Alexander Schnitzler <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Gerrit Code Review 5 days 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/c/Packages/TYPO3.CMS/+/62518

#2 Updated by Oliver Hader 5 days ago

  • Description updated (diff)

#3 Updated by Oliver Hader 5 days ago

  • Description updated (diff)

#4 Updated by Gerrit Code Review 5 days 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/c/Packages/TYPO3.CMS/+/62518

#5 Updated by Gerrit Code Review 5 days ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62518

#6 Updated by Gerrit Code Review 5 days ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62518

#7 Updated by Oliver Hader 5 days ago

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

Also available in: Atom PDF