diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index 1164756..749b8eb 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -310,7 +310,8 @@ public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, * {@inheritdoc} */ public function hasParentComment() { - $parent = $this->get('pid')->entity; + // Do not load parent comment entity. + $parent = $this->get('pid')->target_id; return !empty($parent); } diff --git a/core/modules/comment/templates/comment.html.twig b/core/modules/comment/templates/comment.html.twig index 5fca73b..4501238 100644 --- a/core/modules/comment/templates/comment.html.twig +++ b/core/modules/comment/templates/comment.html.twig @@ -43,7 +43,7 @@ * * These variables are provided to give context about the parent comment (if * any): - * - comment_parent: Full parent comment entity (if any). + * - parent_comment: Full parent comment entity (if any). * - parent_author: Equivalent to author for the parent comment. * - parent_created: Equivalent to created for the parent comment. * - parent_changed: Equivalent to changed for the parent comment. @@ -87,8 +87,8 @@ for accessibility. The list is difficult to navigate in a screen reader without this information. #} - {% if parent %} -

{{ parent }}

+ {% if parent_comment %} +

{{ "In reply to !parent_title by !parent_author"|t({ '!parent_title': parent_title, '!parent_author': parent_author }) }}

{% endif %} {{ permalink }}