See comment
Can you please test in a test environment to:
Add a content type
Add a relation using that content type
Remove the content type
If we get a 500 the bug needs to be fixed, otherwise only the affected installation needs a DB fix
I tested this, by:
adding a new content type named 'tijdelijk' (article),
adding a new relation named 'tijdelijk' (taxonomy, linked content type 'Tijdelijk' and 'Event category', multiple, not required),
deleted the content type named 'Tijdelijk',
trying to open the item page of relation item named 'Tijdelijk', after clicking the next error appeared: Fatal error: Method MongoDBODMProxies_CG\Integrated\Bundle\ContentBundle\Document\ContentType\ContentType::_toString() must not throw an exception in /home/CUSTOMERNAME/app/cache/prod/classes.php on line 0
should we use cascade options to remove the content type references in the relations as well (http://doctrine-orm.readthedocs.org/projects/doctrine-mongodb-odm/en/latest/reference/reference-mapping.html)?
I think an event listener.
Cascade (remove) will remove the content type if the relation is removed (if I remember correctly).
If I am wrong we should use the cascade option, otherwise a Doctrine event listener.