core/modules/comment/src/CommentViewBuilder.php | 2 +- core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/comment/src/CommentViewBuilder.php b/core/modules/comment/src/CommentViewBuilder.php index 0376a77..fe27860 100644 --- a/core/modules/comment/src/CommentViewBuilder.php +++ b/core/modules/comment/src/CommentViewBuilder.php @@ -156,7 +156,7 @@ public function buildComponents(array &$build, array $entities, array $displays, $account = comment_prepare_author($entity); $config = \Drupal::config('user.settings'); - $build['#cache']['tags'] = Cache::mergeTags($build['#cache']['tags'], $config->getCacheTags()); + $build['#cache']['tags'] = Cache::mergeTags(isset($build['#cache']['tags']) ? $build['#cache']['tags'] : [], $config->getCacheTags()); if ($config->get('signatures') && $account->getSignature()) { $build[$id]['signature'] = array( '#type' => 'processed_text', diff --git a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php index 1a97e1b..fc4501d 100644 --- a/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php +++ b/core/modules/comment/src/Tests/CommentDefaultFormatterCacheTagsTest.php @@ -108,6 +108,7 @@ public function testCacheTags() { 'comment_view', 'comment:' . $comment->id(), 'config:filter.format.plain_text', + 'config:user.settings', 'user_view', 'user:2', );