diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 7b4145e..2aac59d 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -820,11 +820,6 @@ function template_preprocess_comment(&$variables) { $variables['status'] = $comment->isPublished() ? 'published' : 'unpublished'; } - // @todo Use $entity->getAuthorId() after https://drupal.org/node/2078387 - if ($commented_entity instanceof EntityOwnerInterface && $comment->getOwnerId() == $commented_entity->getOwnerId()) { - $variables['entity_type'] = $commented_entity->getEntityTypeId(); - } - // Add comment author user ID. Necessary for the comment-by-viewer library. $variables['attributes']['data-comment-user-id'] = $comment->getOwnerId(); } diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 5962e48..2d3d13e 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -70,7 +70,7 @@ status != 'published' ? status, status != 'preview' ? 'permalink', not author_id ? 'by-anonymous', - author_id ? 'by-' ~ entity_type ~ '-author', + author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', 'clearfix', ] %} diff --git a/core/themes/bartik/templates/comment.html.twig b/core/themes/bartik/templates/comment.html.twig index 113a229..f80d4b0 100644 --- a/core/themes/bartik/templates/comment.html.twig +++ b/core/themes/bartik/templates/comment.html.twig @@ -68,7 +68,7 @@ status != 'published' ? status, status != 'preview' ? 'permalink', not author_id ? 'by-anonymous', - author_id ? 'by-' ~ entity_type ~ '-author', + author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', 'clearfix', ] %}