Skip to content


DDC-3115: UnitOfWok can't access proxies protected property #3892

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user machete:

Running the code on different environments for a while now, I have never had any problems. Recently I installed the code onto a different server and I've been experiencing the following issue:

Fatal error: Cannot access protected property DoctrineORMModule\Proxy*CG*\Page\Entity\PageRevision::$date in src/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 2596

I am absolutely clueless, why this happens. It seems to be affecting only specific data rows, as you might reproduce here:

The field is defined as followed:

     * @ORM\Column(type="datetime", options={"default"="CURRENT_TIMESTAMP"})
    protected $date;

However, the exact same database snapshot works fine here:

Attached you will find a screenshot of the datarows. The yellow ones mark each one working and one not working row.

I have no idea what the problem is here.


Comment created by @ocramius:

Discussed this on IRC - very tricky, seems like one of the servers has the reflection property not set to "accessible"


Comment created by machete:

Adding $class->reflFields[$field]->setAccessible(true) before line 2596 resolved this issue. Even after removing it, everything worked fine.

note to self:

[18:23] @ocramius machete_: can you find out where that particular property is instantiated?
[18:23] @ocramius should be in ClassMetadataInfo::wakeUpReflection() or such
[18:25] @ocramius if you find that again, consider looking at locations in the code where new ReflectionClass() is instantiated

@Ocramius Ocramius was assigned by doctrinebot
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.