core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php b/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php index 673cb49..42a1ed9 100644 --- a/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php +++ b/core/modules/node/src/Cache/NodeAccessGrantsCacheContext.php @@ -89,12 +89,12 @@ protected function checkNodeGrants($operation) { public function getCacheableMetadata($operation = NULL) { $cacheable_metadata = new CacheableMetadata(); - $cacheable_metadata->setCacheTags(['user:' . $this->user->id()]); - if (!\Drupal::moduleHandler()->getImplementations('node_grants')) { return $cacheable_metadata; } + $cacheable_metadata->setCacheTags(['user:' . $this->user->id()]); + // If the site is using node grants, this cache context can not be // optimized. return $cacheable_metadata->setCacheMaxAge(0);