diff --git a/modules/block/block.module b/modules/block/block.module index f0c499ef6b7..9a055db7f07 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -519,7 +519,8 @@ function block_list($region) { // Try fetching the block from cache. Block caching is not compatible with // node_access modules. We also preserve the submission of forms in blocks, // by fetching from cache only if the request method is 'GET'. - if (!count(module_implements('node_grants')) && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) { + $blockcache_node_grants = variable_get('block_cache_node_access_bypass', FALSE) || !count(module_implements('node_grants')); + if ($blockcache_node_grants && $_SERVER['REQUEST_METHOD'] == 'GET' && ($cid = _block_get_cache_id($block)) && ($cache = cache_get($cid, 'cache_block'))) { $array = $cache->data; } else { diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc index 3086139bdf7..e376220a820 100644 --- a/modules/system/system.admin.inc +++ b/modules/system/system.admin.inc @@ -1345,7 +1345,7 @@ function system_performance_settings() { '#title' => t('Block cache'), '#default_value' => variable_get('block_cache', CACHE_DISABLED), '#options' => array(CACHE_DISABLED => t('Disabled'), CACHE_NORMAL => t('Enabled (recommended)')), - '#disabled' => count(module_implements('node_grants')), + '#disabled' => !variable_get('block_cache_node_access_bypass', FALSE) || count(module_implements('node_grants')), '#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'), );