summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-03-09 03:48:59 +0000
committerDries Buytaert <dries@buytaert.net>2010-03-09 03:48:59 +0000
commit154d593e5dccbd80d3b37f72387bb723fbb868df (patch)
treea2a2b116d8485793f3f93b2d8c1c11995a16eb0a
parent972d2fed4d5951e7f87af3811c8a01ff559a855d (diff)
downloadbrdo-154d593e5dccbd80d3b37f72387bb723fbb868df.tar.gz
brdo-154d593e5dccbd80d3b37f72387bb723fbb868df.tar.bz2
- Patch #503782 by skilip, Davy Van Den Bremt, eojthebrave, sign: not able to select region at block creation.
-rw-r--r--modules/block/block.admin.inc2
-rw-r--r--modules/block/block.module2
-rw-r--r--modules/block/block.test14
3 files changed, 16 insertions, 2 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 3497a7a28..75c215de9 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -239,7 +239,7 @@ function block_admin_configure($form, &$form_state, $module, $delta) {
'#type' => 'select',
'#title' => $theme->info['name'],
'#default_value' => (!empty($region) ? $region : BLOCK_REGION_NONE),
- '#options' => array(BLOCK_REGION_NONE => t('Disabled')) + $theme->info['regions'],
+ '#options' => array(BLOCK_REGION_NONE => t('<none>')) + system_region_list($key, REGIONS_VISIBLE),
'#expandable' => ($key !== $theme_default),
'#weight' => ($key == $theme_default ? 9 : 10),
);
diff --git a/modules/block/block.module b/modules/block/block.module
index 183148ec6..ad56834e9 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -31,7 +31,7 @@ function block_help($path, $arg) {
$output .= '</dl>';
return $output;
case 'admin/structure/block/add':
- return '<p>' . t('Use this page to create a new custom block. New blocks are disabled by default; assign them to a region, on this page or the <a href="@blocks">Blocks administration page</a>, to make them visible.', array('@blocks' => url('admin/structure/block'))) . '</p>';
+ return '<p>' . t('Use this page to create a new custom block.') . '</p>';
}
if ($arg[0] == 'admin' && $arg[1] == 'structure' && $arg['2'] == 'block' && (empty($arg[3]) || $arg[3] == 'list')) {
$demo_theme = !empty($arg[4]) ? $arg[4] : variable_get('theme_default', 'garland');
diff --git a/modules/block/block.test b/modules/block/block.test
index e80de7c31..a2788d4e4 100644
--- a/modules/block/block.test
+++ b/modules/block/block.test
@@ -44,6 +44,20 @@ class BlockTestCase extends DrupalWebTestCase {
* Test creating custom block, moving it to a specific region and then deleting it.
*/
function testCustomBlock() {
+ // Confirm that hidden regions are not shown as options for block placement
+ // when adding a new block.
+ theme_enable(array('stark'));
+ $themes = list_themes();
+ $this->drupalGet('admin/structure/block/add');
+ foreach ($themes as $key => $theme) {
+ if ($theme->status) {
+ foreach ($theme->info['regions_hidden'] as $hidden_region) {
+ $elements = $this->xpath('//select[@id="edit-regions-' . $key . '"]//option[@value="' . $hidden_region . '"]');
+ $this->assertFalse(isset($elements[0]), t('The hidden region @region is not available for @theme.', array('@region' => $hidden_region, '@theme' => $key)));
+ }
+ }
+ }
+
// Add a new custom block by filling out the input form on the admin/structure/block/add page.
$custom_block = array();
$custom_block['info'] = $this->randomName(8);