core/modules/comment/comment.install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/modules/comment/comment.install b/core/modules/comment/comment.install index 47241c2..7618300 100644 --- a/core/modules/comment/comment.install +++ b/core/modules/comment/comment.install @@ -184,3 +184,13 @@ function comment_update_8301() { $entity_type->set('entity_keys', $keys); $definition_update_manager->updateEntityType($entity_type); } + +/** + * Make the entity_type field for comments required. + */ +function comment_update_8400() { + $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); + $field_definition = $definition_update_manager->getFieldStorageDefinition('entity_type', 'comment'); + $field_definition->setRequired(TRUE); + $definition_update_manager->updateFieldStorageDefinition($field_definition); +}