Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Runtime Notice: Accessing static property Proxies\__CG__\Bundle\Entity\Entity::$lazyPropertiesDefaults as non static. Symfony PropertyAccessor error #16485

Copy link
Copy link
Closed
@etiennerunge

Description

@etiennerunge
Issue body actions

Hi there,

I have an error with Symfony 2.7.6 & Doctrine.
I try to serialize my 'Employee' Entity, which is a child of a Person superclass. This one has a relation with an 'Adresse' Entity.

When I serialize the Employee Entity, Symfony returns this error :

Runtime Notice: Accessing static property Proxies__CG__\WebInscriptionBundle\Entity\Contact\Adresse::$lazyPropertiesDefaults as non static
500 Internal Server Error - ContextErrorException

I understand the problem. Symfony try to access a property of my object, which is a proxy class.
I've changed the 'fetch mode' to EAGER, but nothing's change.
The property of the probleme belong to the proxy class. It's the public static $lazyPropertiesDefaults .
This issue is similar to this : http://stackoverflow.com/q/31623080

Here's the line which failed :
https://github.com/symfony/symfony/blob/v2.7.6/src/Symfony/Component/PropertyAccess/PropertyAccessor.php#L350

the property is static & public, but the getter __getLazyProperties isn't called, and symfony try to access as a public property ( $object->$property ).

So, the fetch mode EAGER seems to work (my entity is hydrated), maybe there is a mistake, a missing test ?
I think the visibility of my variables are ok. 'Protected' in the superclass and 'private' in child Employee Entity. Any ideas ?

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.