Actions
Bug #99463
closednon-static access to static property in AbstractDomainObject.php line 272
Start date:
2023-01-05
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:
On Location Sprint
Description
Error:
PHP Notice: Accessing static property <class>::<property> as non static in [...]/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php line 272
Should be easily reproducable by adding a static property to any domain model (e.g. protected static array $sharedRuntimeCache = [];
) and then dumping it via the extbase DebuggerUtility::var_dump
Solution proposal:
Before:
if ($this->isPropertyDirty($this->_getCleanProperty($propertyName), $this->{$propertyName}) === true) { return true; }
After:
$reflectionProperty = new ReflectionProperty(static::class, $propertyName); if ($reflectionProperty->isStatic()) { $value = static::$$propertyName; } else { $value = $this->{$propertyName}; } if ($this->isPropertyDirty($this->_getCleanProperty($propertyName), $value) === true) { return true; }
Files
Actions