DDC-2735: Can't save user entity with association of type __PHP_Incomplete_Class #3422

Closed
opened 2026-01-22 14:19:33 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 11, 2013).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user personman:

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.

Originally created by @doctrinebot on GitHub (Oct 11, 2013). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user personman: 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](http://www.doctrine-project.org/jira/browse/DDC-1698) But I'm not sure how to fix it.
admin added the Bug label 2026-01-22 14:19:33 +01:00
admin closed this issue 2026-01-22 14:19:33 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 11, 2013):

Comment created by personman:

Clearing my cookies solved this issue.

@doctrinebot commented on GitHub (Oct 11, 2013): Comment created by personman: Clearing my cookies solved this issue.
Author
Owner

@doctrinebot commented on GitHub (Oct 11, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Oct 11, 2013): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Oct 11, 2013):

Comment created by personman:

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

@doctrinebot commented on GitHub (Oct 11, 2013): Comment created by personman: Clearing my cookies got rid of the session that was causing this. Odd.
Author
Owner

@doctrinebot commented on GitHub (Oct 11, 2013):

Comment created by stof:

*_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

@doctrinebot commented on GitHub (Oct 11, 2013): Comment created by stof: `*_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
Author
Owner

@doctrinebot commented on GitHub (Oct 14, 2013):

Comment created by personman:

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

@doctrinebot commented on GitHub (Oct 14, 2013): Comment created by personman: Could I get some help in setting up the proxy autoloader? I'm using DoctrineORMModule in Zend Framework 2.
Author
Owner

@doctrinebot commented on GitHub (Jan 17, 2014):

Comment created by noisnaaria:

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

@doctrinebot commented on GitHub (Jan 17, 2014): Comment created by noisnaaria: Danny Ferguson, you get some help in setting up the proxy autoloader using DoctrineORMModule in Zend Framework 2?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3422