diff --git a/core/modules/block/src/BlockAccessControlHandler.php b/core/modules/block/src/BlockAccessControlHandler.php index dbe866f..4529647 100644 --- a/core/modules/block/src/BlockAccessControlHandler.php +++ b/core/modules/block/src/BlockAccessControlHandler.php @@ -138,7 +138,10 @@ protected function checkAccess(EntityInterface $entity, $operation, AccountInter catch (ContextException $e) { // Setting access to forbidden if any context is missing for the same // reasons as with conditions (described in the comment above). - $access = AccessResult::forbidden(); + // @todo Avoid setting max-age 0 for some or all cases, for example by + // treating available contexts without value differently in + // https://www.drupal.org/node/2521956. + $access = AccessResult::forbidden()->setCacheMaxAge(0); } } else {