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
Updated by Oliver Eglseder almost 2 years ago
- File typo3-extbase-abstractdomainobject-static-access.patch typo3-extbase-abstractdomainobject-static-access.patch added
This patch should do it.
Updated by Georg Ringer 5 months ago
- File Bildschirmfoto 2024-06-20 um 07.43.22.png Bildschirmfoto 2024-06-20 um 07.43.22.png added
- Status changed from New to Needs Feedback
seems to work in at least v13, can you retest this if it still doesn't for you? thanks
Updated by Georg Ringer 4 months ago
- Status changed from Needs Feedback to Closed
closing issue as it couldn't be reproduced and lack of feedback. if still valid in v12, either contact me on slack or open a new issue and reference this one.
Actions