core/modules/comment/comment.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 76f2836..a2f5251 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -458,7 +458,7 @@ function theme_comment_block($variables) { */ function comment_entity_view_alter(&$build, EntityInterface $entity, EntityDisplay $display) { // Add the comment page number to the cache key if render caching is enabled. - if (isset($build['#cache'])) { + if (isset($build['#cache']) && isset($build['#cache']['keys'])) { $request = \Drupal::request(); foreach ($entity->getProperties() as $field_name => $field) { // @todo Support multiple unique comment pagers once