Project

General

Profile

Actions

Bug #99463

open

non-static access to static property in AbstractDomainObject.php line 272

Added by Oliver Eglseder over 1 year ago. Updated over 1 year ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
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:

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

Also available in: Atom PDF