Project

General

Profile

Actions

Bug #71566

open

ObjectAcess with combination of LazyLoadingProxy fails to fetch bool properties

Added by Viktor Livakivskyi over 8 years ago. Updated over 7 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-11-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

I have a situation, when an object, validated by GenericObjectValidator contains @lazy relation to another object, which itself contains boolean value, fetched by is*() method.

Simplified code:

class MyObject
{
    /**
     * @var \Vendor\Relation
     * @lazy
     */
    protected $relation;

...
}

class Relation
{
    /**
     * @var boolean
     */
    protected $boolean;

    public function isBoolean()
    {
        return $this->boolean;
    }    
}

When 'MyObject' is validated, due to recursive validation 'Relation' is also validated. But at the moment of validation the relation is substituted with LazyLoadingProxy. And, when ObjectAccess asks is_callable(array($proxy, 'getBoolean')) in getPropertyInternal(), it receives true, because it is callable on Proxy, but in fact it is not callable on original object and a PHP error occurs.

Actions

Also available in: Atom PDF