summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/common.inc6
-rw-r--r--includes/theme.inc1
-rw-r--r--includes/theme.maintenance.inc1
-rw-r--r--modules/block/block.module31
-rw-r--r--modules/block/block.test26
-rw-r--r--modules/system/system.admin.inc7
-rw-r--r--modules/system/system.module1
-rw-r--r--modules/system/system.test18
8 files changed, 34 insertions, 57 deletions
diff --git a/includes/common.inc b/includes/common.inc
index bb4777dcc..25f9fbdad 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -424,9 +424,6 @@ function drupal_not_found() {
drupal_set_page_content($return);
$page = element_info('page');
- // Optionally omit the blocks to conserve CPU and bandwidth.
- $page['#show_blocks'] = variable_get('site_404_blocks', FALSE);
-
print drupal_render_page($page);
}
@@ -3893,7 +3890,6 @@ function drupal_set_page_content($content = NULL) {
* A string or array representing the content of a page. The array consists of
* the following keys:
* - #type: Value is always 'page'. This pushes the theming through page.tpl.php (required).
- * - #show_blocks: A marker which suppresses sidebar regions if FALSE (optional).
* - #show_messages: Suppress drupal_get_message() items. Used by Batch API (optional).
*
* @see hook_page_alter()
@@ -4258,7 +4254,7 @@ function drupal_common_theme() {
'template' => 'page',
),
'maintenance_page' => array(
- 'arguments' => array('content' => NULL, 'show_blocks' => TRUE, 'show_messages' => TRUE),
+ 'arguments' => array('content' => NULL, 'show_messages' => TRUE),
'template' => 'maintenance-page',
'path' => 'includes',
'file' => 'theme.maintenance.inc',
diff --git a/includes/theme.inc b/includes/theme.inc
index e3b197697..23c8ab9c0 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -2022,7 +2022,6 @@ function template_process(&$variables, $hook) {
*/
function template_preprocess_page(&$variables) {
// Move some variables to the top level for themer convenience and template cleanliness.
- $variables['show_blocks'] = $variables['page']['#show_blocks'];
$variables['show_messages'] = $variables['page']['#show_messages'];
// Add favicon.
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 69e675e04..3f94aaed8 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -208,7 +208,6 @@ function theme_update_page($content, $show_messages = TRUE) {
*
* The $variables array contains the following arguments:
* - $content
- * - $show_blocks
*
* @see maintenance-page.tpl.php
*/
diff --git a/modules/block/block.module b/modules/block/block.module
index 0361a8b47..cc1e63ba4 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -246,24 +246,21 @@ function block_page_alter($page) {
// Load all region content assigned via blocks.
foreach (array_keys($all_regions) as $region) {
- // Prevent sidebar regions from rendering blocks when 'show_blocks' == FALSE.
- if (!empty($page['#show_blocks']) || (strpos($region, 'sidebar_') !== 0)) {
- // Assign blocks to region.
- if ($blocks = block_get_blocks_by_region($region)) {
- $page[$region] = $blocks;
- }
+ // Assign blocks to region.
+ if ($blocks = block_get_blocks_by_region($region)) {
+ $page[$region] = $blocks;
+ }
- // Append region description if we are rendering the block admin page.
- $item = menu_get_item();
- if ($item['path'] == 'admin/structure/block') {
- $visible_regions = system_region_list($theme, REGIONS_VISIBLE);
- if (isset($visible_regions[$region])) {
- $description = '<div class="block-region">' . $all_regions[$region] . '</div>';
- $page[$region]['block_description'] = array(
- '#markup' => $description,
- '#weight' => 15,
- );
- }
+ // Append region description if we are rendering the block admin page.
+ $item = menu_get_item();
+ if ($item['path'] == 'admin/structure/block') {
+ $visible_regions = system_region_list($theme, REGIONS_VISIBLE);
+ if (isset($visible_regions[$region])) {
+ $description = '<div class="block-region">' . $all_regions[$region] . '</div>';
+ $page[$region]['block_description'] = array(
+ '#markup' => $description,
+ '#weight' => 15,
+ );
}
}
}
diff --git a/modules/block/block.test b/modules/block/block.test
index e5217d3f9..414c1d882 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -104,9 +104,21 @@ class BlockTestCase extends DrupalWebTestCase {
*/
function testBlockVisibility() {
$block = array();
- $block['title'] = 'Syndicate';
- $block['module'] = 'node';
- $block['delta'] = 'syndicate';
+
+ // Create a random title for the block
+ $title = $this->randomName(8);
+
+ // Create the custom block
+ $box = array();
+ $box['info'] = $this->randomName(8);
+ $box['title'] = $title;
+ $box['body'] = $this->randomName(32);
+ $this->drupalPost('admin/structure/block/add', $box, t('Save block'));
+
+ $bid = db_query("SELECT bid FROM {box} WHERE info = :info", array(':info' => $box['info']))->fetchField();
+ $block['module'] = 'block';
+ $block['delta'] = $bid;
+ $block['title'] = $title;
// Set the block to be hidden on any user path, and to be shown only to
// authenticated users.
@@ -119,15 +131,15 @@ class BlockTestCase extends DrupalWebTestCase {
$this->moveBlockToRegion($block, $this->regions[1]);
$this->drupalGet('');
- $this->assertText('Syndicate', t('Block was displayed on the front page.'));
+ $this->assertText($title, t('Block was displayed on the front page.'));
- $this->drupalGet('user*');
- $this->assertNoText('Syndicate', t('Block was not displayed according to block visibility rules.'));
+ $this->drupalGet('user');
+ $this->assertNoText($title, t('Block was not displayed according to block visibility rules.'));
// Confirm that the block is not displayed to anonymous users.
$this->drupalLogout();
$this->drupalGet('');
- $this->assertNoText('Syndicate', t('Block was not displayed to anonymous users.'));
+ $this->assertNoText($title, t('Block was not displayed to anonymous users.'));
}
/**
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 3b115c872..0f98ef355 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1308,12 +1308,6 @@ function system_site_information_settings() {
'#description' => t('This page is displayed when no other content matches the requested document. Leave blank to display a generic "page not found" page.'),
'#field_prefix' => url(NULL, array('absolute' => TRUE)) . (variable_get('clean_url', 0) ? '' : '?q=')
);
- $form['site_404_blocks'] = array(
- '#type' => 'checkbox',
- '#title' => t('Display blocks on default 404 (not found) page'),
- '#description' => t('Render all blocks on the default 404 (not found) page. Disabling blocks can help with performance but might leave users with a less functional site.'),
- '#default_value' => variable_get('site_404_blocks', 0)
- );
$form['cron_safe_threshold'] = array(
'#type' => 'select',
'#title' => t('Automatically run cron'),
@@ -1941,7 +1935,6 @@ function system_batch_page() {
// display a list of collected messages later.
drupal_set_page_content($output);
$page = element_info('page');
- $page['#show_blocks'] = FALSE;
$page['#show_messages'] = FALSE;
return $page;
}
diff --git a/modules/system/system.module b/modules/system/system.module
index e7342e699..502f22b3e 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -291,7 +291,6 @@ function system_elements() {
$type['page'] = array(
'#show_messages' => TRUE,
- '#show_blocks' => TRUE,
'#theme' => 'page',
);
diff --git a/modules/system/system.test b/modules/system/system.test
index b5176fd85..ae77dc0dd 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -626,24 +626,6 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->drupalGet($this->randomName(10));
$this->assertText($node->title, t('Found the custom 404 page'));
-
- // Logout and check that the user login block is not shown on custom 404 pages.
- $this->drupalLogout();
-
- $this->drupalGet($this->randomName(10));
- $this->assertText($node->title, t('Found the custom 404 page'));
- $this->assertNoText(t('User login'), t('Blocks are not shown on the custom 404 page'));
-
- // Log back in and remove the custom 404 page.
- $this->drupalLogin($this->admin_user);
- $this->drupalPost('admin/settings/site-information', array('site_404' => ''), t('Save configuration'));
-
- // Logout and check that the user login block is not shown on default 404 pages.
- $this->drupalLogout();
-
- $this->drupalGet($this->randomName(10));
- $this->assertText(t('Page not found'), t('Found the default 404 page'));
- $this->assertNoText(t('User login'), t('Blocks are not shown on the default 404 page'));
}
}