From 4b10db3a437471ee614bc6f7ce4fd54499047199 Mon Sep 17 00:00:00 2001 From: Bill Schaller Date: Fri, 20 Mar 2015 13:59:27 -0400 Subject: [PATCH] Fix crashes in ConvertMappingCommand and GenerateEntitiesCommand when using entities with joined table inheritance ConvertMappingCommand and GenerateEntitiesCommand both use the DisconnectedClassMetadataFactory, which allows metadata manipulation without loading the associated classes. Commit a36bea broke these two commands by adding a bailout condition in ClassMetadataFactory::populateDiscriminatorValue which checks $metadata->reflClass->isAbstract(). If the DisconnectedClassMetadataFactory is being used, $metadata->reflClass will always be null, causing a fatal error, "Fatal error: Call to a member function isAbstract() on null". This commit adds a check to see if $metadata->reflClass is set before checking isAbstract. --- lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php index 0596e9746..e0eacfa53 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php @@ -311,6 +311,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory if ($metadata->discriminatorValue || ! $metadata->discriminatorMap || $metadata->isMappedSuperclass + || ! $metadata->reflClass || $metadata->reflClass->isAbstract() ) { return;