core/modules/comment/src/CommentViewBuilder.php | 6 ++---- core/modules/comment/src/Entity/Comment.php | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php index 38e021e..cf8b7b2 100644 --- a/core/modules/comment/src/CommentViewBuilder.php +++ b/core/modules/comment/src/CommentViewBuilder.php @@ -73,11 +73,9 @@ public function __construct(EntityTypeInterface $entity_type, EntityManagerInter protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langcode) { $build = parent::getBuildDefaults($entity, $view_mode, $langcode); - // The commented entity is invalidated when another comment is added. If - // threading is enabled, make sure the rendered comments are invalidated as - // well, to refresh comment positioning/indentation. + // If threading is enabled, don't render cache individual comments. if ($entity->getCommentedEntity()->getFieldDefinition($entity->getFieldName())->getSetting('default_mode')) { - $build['#cache']['tags'] = NestedArray::mergeDeep($build['#cache']['tags'], $entity->getCommentedEntity()->getCacheTag()); + unset($build['#cache']); } return $build; diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index b6cf6f5..b49d993 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -40,7 +40,6 @@ * uri_callback = "comment_uri", * fieldable = TRUE, * translatable = TRUE, - * render_cache = FALSE, * entity_keys = { * "id" = "cid", * "bundle" = "comment_type",