diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 8ec53d9..7d22dde 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -699,7 +699,7 @@ function template_preprocess_comment(&$variables) { ); $variables['author'] = drupal_render($username); $variables['author_id'] = $comment->getOwnerId(); - $variables['author_anonymous'] = $comment->getOwner()->isAnonymous(); + $variables['author_is_anonymous'] = $comment->getOwner()->isAnonymous(); $variables['new_indicator_timestamp'] = $comment->getChangedTime(); $variables['created'] = format_date($comment->getCreatedTime()); // Avoid calling format_date() twice on the same timestamp. diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 1da2a3b..07bc3b1 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -5,6 +5,8 @@ * * Available variables: * - author: Comment author. Can be a link or plain text. + * - author_is_anonymous: A flag indicating if the comment was submitted + * anonymously. * - content: The content-related items for the comment display. Use * {{ content }} to print them all, or print a subset such as * {{ content.field_example }}. Use the following code to temporarily suppress @@ -70,7 +72,7 @@ set classes = [ 'comment', status != 'published' ? status, - author_anonymous ? 'by-anonymous', + author_is_anonymous ? 'by-anonymous', author_id and 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 92e7a82..acbffb2 100644 --- a/core/themes/bartik/templates/comment.html.twig +++ b/core/themes/bartik/templates/comment.html.twig @@ -5,6 +5,8 @@ * * Available variables: * - author: Comment author. Can be a link or plain text. + * - author_is_anonymous: A flag indicating if the comment was submitted + * anonymously. * - content: The content-related items for the comment display. Use * {{ content }} to print them all, or print a subset such as * {{ content.field_example }}. Use the following code to temporarily suppress @@ -68,7 +70,7 @@ set classes = [ 'comment', status != 'published' ? status, - author_anonymous ? 'by-anonymous', + author_is_anonymous ? 'by-anonymous', author_id and author_id == commented_entity.getOwnerId() ? 'by-' ~ commented_entity.getEntityTypeId() ~ '-author', 'clearfix', ]