- Patch #427296 by taz88ny: move some code from system.module to bloc.module where it belongs.
parent
f6db2a4cd7
commit
ff9b6c611e
|
@ -456,6 +456,22 @@ function block_form_system_performance_settings_alter(&$form, &$form_state) {
|
|||
'#disabled' => count(module_implements('node_grants')),
|
||||
'#description' => t('Note that block caching is inactive when modules defining content access restrictions are enabled.'),
|
||||
);
|
||||
|
||||
// Check if the "Who's online" block is enabled.
|
||||
$online_block_enabled = db_select('block')
|
||||
->condition('module', 'user')
|
||||
->condition('delta', 'online')
|
||||
->condition('status', 1)
|
||||
->countQuery()
|
||||
->execute()
|
||||
->fetchField();
|
||||
|
||||
// If the "Who's online" block is enabled, append some descriptive text to
|
||||
// the end of the form description.
|
||||
if ($online_block_enabled) {
|
||||
$form['page_cache']['cache']['#description'] .= '<p>' . t('When caching is enabled, anonymous user sessions are only saved to the database when needed, so the "Who\'s online" block does not display the number of anonymous users.') . '</p>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1296,18 +1296,6 @@ function system_performance_settings() {
|
|||
|
||||
$description = '<p>' . t("The normal cache mode is suitable for most sites and does not cause any side effects. The aggressive cache mode causes Drupal to skip the loading (boot) and unloading (exit) of enabled modules when serving a cached page. This results in an additional performance boost but can cause unwanted side effects.") . '</p>';
|
||||
|
||||
// Check if the "Who's online" block is enabled.
|
||||
$online_block_enabled = db_select('block')
|
||||
->condition('module', 'user')
|
||||
->condition('delta', 'online')
|
||||
->condition('status', 1)
|
||||
->countQuery()
|
||||
->execute()
|
||||
->fetchField();
|
||||
if ($online_block_enabled) {
|
||||
$description .= '<p>' . t("When caching is enabled, anonymous user sessions are only saved to the database when needed, so the \"Who's online\" block does not display the number of anonymous users.") . '</p>';
|
||||
}
|
||||
|
||||
$problem_modules = array_unique(array_merge(module_implements('boot'), module_implements('exit')));
|
||||
sort($problem_modules);
|
||||
|
||||
|
|
Loading…
Reference in New Issue