Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the blockcache_bypass_node_grants variable. #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/block/block.module
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion modules/system/system.admin.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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.'),
);

Expand Down