diff --git a/eck.module b/eck.module index 6d34a34a256fa7817c53df720718732e584fca54..b07db9c919a0455595cf9d4c8dcf4b8e04f44e60 100644 --- a/eck.module +++ b/eck.module @@ -145,6 +145,16 @@ function eck_entity_type_build(array &$entity_types) { ]; // Merge the definitions. $definition = array_merge($definition, $base_definition); + + // Remove the title entity key if not enabled. + if (!$eck_type->hasTitleField()) { + unset($definition['entity_keys']['label']); + } + // Remove the status entity key if not enabled. + if (!$eck_type->hasStatusField()) { + unset($definition['entity_keys']['published']); + } + // Add the new content entity to the entity types. $entity_types[$definition['id']] = new ContentEntityType($definition);