Skip to content
Snippets Groups Projects
Commit ff9b6c61 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #427296 by taz88ny: move some code from system.module to bloc.module where it belongs.

parent f6db2a4c
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment