[DDC-2735] Can't save user entity with association of type __PHP_Incomplete_Class Created: 11/Oct/13  Updated: 17/Jan/14  Resolved: 11/Oct/13

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: Git Master
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Danny Ferguson Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: orm


 Description   

This was working until I did some updating in composer. I'm not entirely sure which package changed to cause this, but when I save my user entity now, I get this error:

Fatal error: Uncaught exception 'Doctrine\ORM\ORMException' with message
'Found entity of type __PHP_Incomplete_Class on association Mrss\Entity\User#college,
but expecting Mrss\Entity\College' in
[...]/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php on line 783

This seems to be related to this issue here: http://www.doctrine-project.org/jira/browse/DDC-1698

But I'm not sure how to fix it.



 Comments   
Comment by Danny Ferguson [ 11/Oct/13 ]

Clearing my cookies solved this issue.

Comment by Danny Ferguson [ 11/Oct/13 ]

Clearing my cookies got rid of the session that was causing this. Odd.

Comment by Christophe Coevoet [ 11/Oct/13 ]

__PHP_Incomplete_Class is used by PHP when you try to unserialize an object and it cannot find the class for it.

If you are serializing objects in your session and you are deleting a class, you need to remove the sessions stored on the server when deleting the class (removing the cooie solved it for you because it also removed the session cookie and so you got a fresh session without the broken serialized data, but it would still happen for your other users)

If you are serializing doctrine proxy objects, you should register the proxy autoloader to be able to deserialize them

Comment by Danny Ferguson [ 14/Oct/13 ]

Could I get some help in setting up the proxy autoloader? I'm using DoctrineORMModule in Zend Framework 2.

Comment by Phillipe Rosário [ 17/Jan/14 ]

Danny Ferguson, you get some help in setting up the proxy autoloader using DoctrineORMModule in Zend Framework 2?

Generated at Sat Oct 25 08:03:18 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.