Project

General

Profile

Actions

Bug #99463

closed

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

Added by Oliver Eglseder almost 2 years ago. Updated 4 months ago.

Status:
Closed
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:
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 #2

Updated by Georg Ringer 5 months ago

  • Sprint Focus set to On Location Sprint
Actions #3

Updated by Georg Ringer 5 months ago

seems to work in at least v13, can you retest this if it still doesn't for you? thanks

Actions #4

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

Also available in: Atom PDF