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.
This commit is contained in:
parent
24425436b0
commit
4b10db3a43
@ -311,6 +311,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
|
||||
if ($metadata->discriminatorValue
|
||||
|| ! $metadata->discriminatorMap
|
||||
|| $metadata->isMappedSuperclass
|
||||
|| ! $metadata->reflClass
|
||||
|| $metadata->reflClass->isAbstract()
|
||||
) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user