diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index b197116..cd5b946 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -159,6 +159,7 @@ function comment_theme() { ), 'field__comment' => array( 'template' => 'field--comment', + 'base hook' => 'field', ), ); } diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php index c774648..28fa882 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php @@ -176,7 +176,14 @@ public function viewElements(FieldItemListInterface $items) { } $elements[] = $output + array( - '#theme' => 'field__comment', + '#theme' => array( + 'field__comment__' . $entity->getEntityTypeId() . '__' . $items->getFieldDefinition()->getName() . '__' . $entity->bundle(), + 'field__comment__' . $entity->getEntityTypeId() . '__' . $items->getFieldDefinition()->getName(), + 'field__comment__' . $entity->getEntityTypeId() . '__' . $entity->bundle(), + 'field__comment__' . $entity->getEntityTypeId(), + 'field__comment', + 'field', + ), '#entity' => $entity, '#display_mode' => $this->getFieldSetting('default_mode'), 'comments' => array(), diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 7b35fca..2ac1956 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -706,7 +706,6 @@ function system_theme_suggestions_field(array $variables) { $element = $variables['element']; $suggestions[] = 'field__' . $element['#field_type']; - $suggestions[] = 'field__' . $element['#field_name']; $suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#bundle']; $suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#field_name']; $suggestions[] = 'field__' . $element['#entity_type'] . '__' . $element['#field_name'] . '__' . $element['#bundle'];