Commit 410fcdc7 authored by webchick's avatar webchick
Browse files

#761956 by David_Rothstein, Xen, sun, tstoeckler, Bojhan, zzolo, yoroy,...

#761956 by David_Rothstein, Xen, sun, tstoeckler, Bojhan, zzolo, yoroy, jenlampton, linclark, BarisW: Fixed Dashboard blocks and regions should not appear on the main blocks configuration page.
parent 10fca34c
......@@ -787,10 +787,10 @@ class AggregatorRenderingTestCase extends AggregatorTestCase {
);
$region = 'footer';
$edit = array();
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = $region;
$edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = $region;
// Check the feed block is available in the block list form.
$this->drupalGet('admin/structure/block');
$this->assertFieldByName($block['module'] . '_' . $block['delta'] . '[region]', '', 'Aggregator feed block is available for positioning.');
$this->assertFieldByName('blocks[' . $block['module'] . '_' . $block['delta'] . '][region]', '', 'Aggregator feed block is available for positioning.');
// Position it.
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
......
......@@ -32,30 +32,61 @@ function block_admin_display($theme = NULL) {
}
// Fetch and sort blocks.
$blocks = block_admin_display_prepare_blocks($theme);
return drupal_get_form('block_admin_display_form', $blocks, $theme);
}
/**
* Prepares a list of blocks for display on the blocks administration page.
*
* @param $theme
* The machine-readable name of the theme whose blocks should be returned.
*
* @return
* An array of blocks, as returned by _block_rehash(), sorted by region in
* preparation for display on the blocks administration page.
*
* @see block_admin_display_form()
*/
function block_admin_display_prepare_blocks($theme) {
$blocks = _block_rehash($theme);
$compare_theme = &drupal_static('_block_compare:theme');
$compare_theme = $theme;
usort($blocks, '_block_compare');
return drupal_get_form('block_admin_display_form', $blocks, $theme);
return $blocks;
}
/**
* Form builder for the main blocks administration form.
*
* @param $blocks
* An array of all blocks returned by modules in hook_block_info().
* An array of blocks, as returned by block_admin_display_prepare_blocks().
* @param $theme
* A string representing the name of the theme to edit blocks for.
* @param $block_regions
* (optional) An array of regions in which the blocks will be allowed to be
* placed. Defaults to all visible regions for the theme whose blocks are
* being configured. In all cases, a dummy region for disabled blocks will
* also be displayed.
*
* @return
* An array representing the form definition.
*
* @see block_admin_display_form_submit()
* @ingroup forms
* @see block_admin_display_form_submit()
*/
function block_admin_display_form($form, &$form_state, $blocks, $theme) {
function block_admin_display_form($form, &$form_state, $blocks, $theme, $block_regions = NULL) {
drupal_add_css(drupal_get_path('module', 'block') . '/block.css');
$block_regions = system_region_list($theme, REGIONS_VISIBLE) + array(BLOCK_REGION_NONE => '<' . t('none') . '>');
// Get a list of block regions if one was not provided.
if (!isset($block_regions)) {
$block_regions = system_region_list($theme, REGIONS_VISIBLE);
}
// We always add a region for disabled blocks.
$block_regions += array(BLOCK_REGION_NONE => '<' . t('none') . '>');
// Weights range from -delta to +delta, so delta should be at least half
// of the amount of blocks present. This makes sure all blocks in the same
......@@ -63,46 +94,53 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme) {
$weight_delta = round(count($blocks) / 2);
// Build the form tree.
$form['edited_theme'] = array('#type' => 'value', '#value' => $theme);
$form['#action'] = arg(4) ? url('admin/structure/block/list/' . $theme) : url('admin/structure/block');
$form['edited_theme'] = array(
'#type' => 'value',
'#value' => $theme,
);
$form['block_regions'] = array(
'#type' => 'value',
'#value' => $block_regions,
);
$form['blocks'] = array();
$form['#tree'] = TRUE;
foreach ($blocks as $i => $block) {
$key = $block['module'] . '_' . $block['delta'];
$form[$key]['module'] = array(
$form['blocks'][$key]['module'] = array(
'#type' => 'value',
'#value' => $block['module'],
);
$form[$key]['delta'] = array(
$form['blocks'][$key]['delta'] = array(
'#type' => 'value',
'#value' => $block['delta'],
);
$form[$key]['info'] = array(
$form['blocks'][$key]['info'] = array(
'#markup' => check_plain($block['info']),
);
$form[$key]['theme'] = array(
$form['blocks'][$key]['theme'] = array(
'#type' => 'hidden',
'#value' => $theme,
);
$form[$key]['weight'] = array(
$form['blocks'][$key]['weight'] = array(
'#type' => 'weight',
'#default_value' => $block['weight'],
'#delta' => $weight_delta,
'#title_display' => 'invisible',
'#title' => t('Weight for @row', array('@row' => $block['info'])),
);
$form[$key]['region'] = array(
$form['blocks'][$key]['region'] = array(
'#type' => 'select',
'#default_value' => $block['region'],
'#options' => $block_regions,
);
$form[$key]['configure'] = array(
$form['blocks'][$key]['configure'] = array(
'#type' => 'link',
'#title' => t('configure'),
'#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/configure',
);
if ($block['module'] == 'block') {
$form[$key]['delete'] = array(
$form['blocks'][$key]['delete'] = array(
'#type' => 'link',
'#title' => t('delete'),
'#href' => 'admin/structure/block/manage/' . $block['module'] . '/' . $block['delta'] . '/delete',
......@@ -110,7 +148,7 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme) {
}
}
// Do not allow disabling the main system content block.
unset($form['system_main']['region']['#options'][BLOCK_REGION_NONE]);
unset($form['blocks']['system_main']['region']['#options'][BLOCK_REGION_NONE]);
$form['actions'] = array(
'#tree' => FALSE,
......@@ -132,7 +170,7 @@ function block_admin_display_form($form, &$form_state, $blocks, $theme) {
function block_admin_display_form_submit($form, &$form_state) {
$txn = db_transaction();
foreach ($form_state['values'] as $block) {
foreach ($form_state['values']['blocks'] as $block) {
$block['status'] = (int) ($block['region'] != BLOCK_REGION_NONE);
$block['region'] = $block['status'] ? $block['region'] : '';
db_update('block')
......@@ -590,7 +628,7 @@ function block_custom_block_delete_submit($form, &$form_state) {
}
/**
* Process variables for block-admin-display.tpl.php.
* Processes variables for block-admin-display-form.tpl.php.
*
* The $variables array contains the following arguments:
* - $form
......@@ -599,11 +637,12 @@ function block_custom_block_delete_submit($form, &$form_state) {
* @see theme_block_admin_display()
*/
function template_preprocess_block_admin_display_form(&$variables) {
$variables['block_regions'] = $variables['form']['block_regions']['#value'];
if (isset($variables['block_regions'][BLOCK_REGION_NONE])) {
$variables['block_regions'][BLOCK_REGION_NONE] = t('Disabled');
}
$block_regions = system_region_list($variables['form']['edited_theme']['#value'], REGIONS_VISIBLE);
$variables['block_regions'] = $block_regions + array(BLOCK_REGION_NONE => t('Disabled'));
foreach ($block_regions as $key => $value) {
foreach ($variables['block_regions'] as $key => $value) {
// Initialize an empty array for the region.
$variables['block_listing'][$key] = array();
}
......@@ -611,33 +650,28 @@ function template_preprocess_block_admin_display_form(&$variables) {
// Initialize disabled blocks array.
$variables['block_listing'][BLOCK_REGION_NONE] = array();
// Set up to track previous region in loop.
$last_region = '';
foreach (element_children($variables['form']) as $i) {
$block = &$variables['form'][$i];
// Only take form elements that are blocks.
if (isset($block['info'])) {
// Fetch region for current block.
$region = $block['region']['#default_value'];
// Set special classes needed for table drag and drop.
$variables['form'][$i]['region']['#attributes']['class'] = array('block-region-select', 'block-region-' . $region);
$variables['form'][$i]['weight']['#attributes']['class'] = array('block-weight', 'block-weight-' . $region);
$variables['block_listing'][$region][$i] = new stdClass();
$variables['block_listing'][$region][$i]->row_class = !empty($block['#attributes']['class']) ? implode(' ', $block['#attributes']['class']) : '';
$variables['block_listing'][$region][$i]->block_modified = !empty($block['#attributes']['class']) && in_array('block-modified', $block['#attributes']['class']);
$variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']);
$variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']);
$variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']);
$variables['block_listing'][$region][$i]->configure_link = drupal_render($block['configure']);
$variables['block_listing'][$region][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : '';
$variables['block_listing'][$region][$i]->printed = FALSE;
$last_region = $region;
}
// Add each block in the form to the appropriate place in the block listing.
foreach (element_children($variables['form']['blocks']) as $i) {
$block = &$variables['form']['blocks'][$i];
// Fetch the region for the current block.
$region = $block['region']['#default_value'];
// Set special classes needed for table drag and drop.
$block['region']['#attributes']['class'] = array('block-region-select', 'block-region-' . $region);
$block['weight']['#attributes']['class'] = array('block-weight', 'block-weight-' . $region);
$variables['block_listing'][$region][$i] = new stdClass();
$variables['block_listing'][$region][$i]->row_class = !empty($block['#attributes']['class']) ? implode(' ', $block['#attributes']['class']) : '';
$variables['block_listing'][$region][$i]->block_modified = !empty($block['#attributes']['class']) && in_array('block-modified', $block['#attributes']['class']);
$variables['block_listing'][$region][$i]->block_title = drupal_render($block['info']);
$variables['block_listing'][$region][$i]->region_select = drupal_render($block['region']) . drupal_render($block['theme']);
$variables['block_listing'][$region][$i]->weight_select = drupal_render($block['weight']);
$variables['block_listing'][$region][$i]->configure_link = drupal_render($block['configure']);
$variables['block_listing'][$region][$i]->delete_link = !empty($block['delete']) ? drupal_render($block['delete']) : '';
$variables['block_listing'][$region][$i]->printed = FALSE;
}
$variables['form_submit'] = drupal_render_children($variables['form']);
}
......@@ -120,7 +120,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the created custom block to a specific region.
$bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
$edit = array();
$edit['block_' . $bid . '[region]'] = $this->regions[1];
$edit['blocks[block_' . $bid . '][region]'] = $this->regions[1];
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the custom block is being displayed using configured text format.
......@@ -215,7 +215,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the block to the disabled region.
$edit = array();
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = '-1';
$edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = '-1';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
......@@ -228,7 +228,7 @@ class BlockTestCase extends DrupalWebTestCase {
// For convenience of developers, put the navigation block back.
$edit = array();
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = $this->regions[1];
$edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = $this->regions[1];
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to first sidebar region.'));
......@@ -239,7 +239,7 @@ class BlockTestCase extends DrupalWebTestCase {
function moveBlockToRegion($block, $region) {
// Set the created block to a specific region.
$edit = array();
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = $region;
$edit['blocks[' . $block['module'] . '_' . $block['delta'] . '][region]'] = $region;
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
......@@ -418,7 +418,7 @@ class BlockCacheTestCase extends DrupalWebTestCase {
variable_set('block_cache', TRUE);
// Enable our test block.
$edit['block_test_test_cache[region]'] = 'sidebar_first';
$edit['blocks[block_test_test_cache][region]'] = 'sidebar_first';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
}
......@@ -594,7 +594,7 @@ class BlockHTMLIdTestCase extends DrupalWebTestCase {
$this->drupalLogin($this->admin_user);
// Enable our test block.
$edit['block_test_test_html_id[region]'] = 'sidebar_first';
$edit['blocks[block_test_test_html_id][region]'] = 'sidebar_first';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
// Make sure the block has some content so it will appear
......
......@@ -62,7 +62,7 @@ class BlogTestCase extends DrupalWebTestCase {
$this->drupalLogin($this->big_user);
// Enable the recent blog block.
$edit = array();
$edit['blog_recent[region]'] = 'sidebar_second';
$edit['blocks[blog_recent][region]'] = 'sidebar_second';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
// Verify ability to change number of recent blog posts in block.
......
......@@ -271,7 +271,7 @@ class BookBlockTestCase extends DrupalWebTestCase {
// Set the block to a region to confirm block is availble.
$edit = array();
$edit['book_navigation[region]'] = 'footer';
$edit['blocks[book_navigation][region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
}
......
......@@ -1014,7 +1014,7 @@ class CommentBlockFunctionalTest extends CommentHelperCase {
// Set the block to a region to confirm block is available.
$edit = array(
'comment_recent[region]' => 'sidebar_first',
'blocks[comment_recent][region]' => 'sidebar_first',
);
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block saved to first sidebar region.'));
......
......@@ -46,11 +46,6 @@
padding: 10px;
}
#dashboard .canvas-content a {
color: #fff;
text-decoration: underline;
}
#dashboard #disabled-blocks .ui-sortable {
padding: 0;
background-color: #777;
......
......@@ -18,6 +18,12 @@ function dashboard_help($path, $arg) {
$output .= '<dd>' . t('By enabling blocks such as <em>Recent blog posts</em>, <em>New forum topics</em> and <em>Recent comments</em>, site users can view newly added site content at a glance.') . '</dd>';
$output .= '</dl>';
return $output;
case 'admin/structure/dashboard':
// @todo This assumes the current page is being displayed using the same
// theme that the dashboard is displayed in.
$output = '<p>' . t('Rearrange blocks for display on the <a href="@dashboard-url">dashboard</a>. Disabling a block makes it available on the main <a href="@blocks-url">blocks administration page</a>.', array('@dashboard-url' => url('admin/dashboard'), '@blocks-url' => url("admin/structure/block/list/{$GLOBALS['theme_key']}"))) . '</p>';
return $output;
}
}
......@@ -25,6 +31,12 @@ function dashboard_help($path, $arg) {
* Implements hook_menu().
*/
function dashboard_menu() {
$items['admin/structure/dashboard'] = array(
'title' => 'Dashboard',
'description' => "Configure which blocks can be shown on the dashboard.",
'page callback' => 'dashboard_admin_blocks',
'access arguments' => array('administer blocks'),
);
$items['admin/dashboard'] = array(
'title' => 'Dashboard',
'description' => 'View and customize your dashboard',
......@@ -59,6 +71,7 @@ function dashboard_menu() {
'access arguments' => array('administer blocks'),
'type' => MENU_CALLBACK,
);
return $items;
}
......@@ -192,9 +205,30 @@ function dashboard_theme() {
'dashboard_disabled_block' => array(
'variables' => array('block' => NULL),
),
'dashboard_admin_display_form' => array(
// When building the form for configuring dashboard blocks, reuse the
// Block module's template for the main block configuration form.
'template' => 'block-admin-display-form',
'path' => drupal_get_path('module', 'block'),
'file' => 'block.admin.inc',
'render element' => 'form',
),
);
}
/**
* Implements hook_forms().
*/
function dashboard_forms() {
// Reroute the dashboard configuration form to the main blocks administration
// form. This allows us to distinguish them by form ID in hook_form_alter().
$forms['dashboard_admin_display_form'] = array(
'callback' => 'block_admin_display_form',
);
return $forms;
}
/**
* Dashboard page callback.
*
......@@ -225,7 +259,7 @@ function dashboard_admin($launch_customize = FALSE) {
);
$build = array(
'#theme' => 'dashboard_admin',
'#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the <a href="@blocks">Blocks administration page</a>, or enable JavaScript on this page to use the drag-and-drop interface.', array('@blocks' => url('admin/structure/block'))),
'#message' => t('To customize the dashboard page, move blocks to the dashboard regions on the <a href="@dashboard">Dashboard administration page</a>, or enable JavaScript on this page to use the drag-and-drop interface.', array('@dashboard' => url('admin/structure/dashboard'))),
'#access' => user_access('administer blocks'),
'#attached' => array(
'js' => array(
......@@ -238,6 +272,113 @@ function dashboard_admin($launch_customize = FALSE) {
return $build;
}
/**
* Menu page callback: builds the page for administering dashboard blocks.
*
* This page reuses the Block module's administration form but limits editing
* to blocks that are available to appear on the dashboard.
*
* @see block_admin_display()
* @see block_admin_display_form()
* @see dashboard_form_dashboard_admin_display_form_alter()
* @see template_preprocess_dashboard_admin_display_form()
*/
function dashboard_admin_blocks() {
global $theme_key;
drupal_theme_initialize();
drupal_set_title(t('Configure available dashboard blocks'));
module_load_include('inc', 'block', 'block.admin');
// Prepare the blocks for the current theme, and remove those that are
// currently displayed in non-dashboard regions.
// @todo This assumes the current page is being displayed using the same
// theme that the dashboard is displayed in.
$blocks = block_admin_display_prepare_blocks($theme_key);
$dashboard_regions = dashboard_region_descriptions();
$regions_to_remove = array_diff_key(system_region_list($theme_key, REGIONS_VISIBLE), $dashboard_regions);
foreach ($blocks as $id => $block) {
if (isset($regions_to_remove[$block['region']])) {
unset($blocks[$id]);
}
}
// Pass in the above blocks and dashboard regions to the form, so that only
// dashboard-related regions will be displayed.
return drupal_get_form('dashboard_admin_display_form', $blocks, $theme_key, $dashboard_regions);
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function dashboard_form_block_admin_display_form_alter(&$form, &$form_state) {
// Hide dashboard regions (and any blocks placed within them) from the block
// administration form and from the options list on that form.
$dashboard_regions = dashboard_region_descriptions();
$form['block_regions']['#value'] = array_diff_key($form['block_regions']['#value'], $dashboard_regions);
foreach (element_children($form['blocks']) as $i) {
$block = &$form['blocks'][$i];
if (isset($block['region']['#default_value']) && isset($dashboard_regions[$block['region']['#default_value']])) {
$block['#access'] = FALSE;
}
elseif (isset($block['region']['#options'])) {
$block['region']['#options'] = array_diff_key($block['region']['#options'], $dashboard_regions);
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function dashboard_form_dashboard_admin_display_form_alter(&$form, &$form_state) {
// Inherit the submit handler from the main block administration form.
$form['#submit'][] = 'block_admin_display_form_submit';
// Redirect the 'configure' and 'delete' links on each block back to the
// dashboard blocks administration page.
foreach ($form['blocks'] as &$block) {
if (isset($block['configure']['#href'])) {
$block['configure']['#options']['query']['destination'] = 'admin/structure/dashboard';
}
if (isset($block['delete']['#href'])) {
$block['delete']['#options']['query']['destination'] = 'admin/structure/dashboard';
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function dashboard_form_block_admin_configure_alter(&$form, &$form_state) {
global $theme_key;
drupal_theme_initialize();
// Hide the dashboard regions from the region select list on the block
// configuration form, for all themes except the current theme (since the
// other themes do not display the dashboard).
// @todo This assumes the current page is being displayed using the same
// theme that the dashboard is displayed in.
$dashboard_regions = dashboard_region_descriptions();
foreach (element_children($form['regions']) as $region_name) {
$region = &$form['regions'][$region_name];
if ($region_name != $theme_key && isset($region['#options'])) {
$region['#options'] = array_diff_key($region['#options'], $dashboard_regions);
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*/
function dashboard_form_block_add_block_form_alter(&$form, &$form_state) {
dashboard_form_block_admin_configure_alter($form, $form_state);
}
/**
* Preprocesses variables for block-admin-display-form.tpl.php.
*/
function template_preprocess_dashboard_admin_display_form(&$variables) {
template_preprocess_block_admin_display_form($variables);
}
/**
* Determines if the dashboard should be displayed on the current page.
*
......@@ -464,7 +605,7 @@ function theme_dashboard_region($variables) {
*/
function theme_dashboard_disabled_blocks($variables) {
extract($variables);
$output = '<div class="canvas-content"><p>' . t('Drag and drop these blocks to the columns below. Changes are automatically saved.') . '</p>';
$output = '<div class="canvas-content"><p>' . t('Drag and drop these blocks to the columns below. Changes are automatically saved. More options are available on the <a href="@dashboard-url">configuration page</a>.', array('@dashboard-url' => url('admin/structure/dashboard'))) . '</p>';
$output .= '<div id="disabled-blocks"><div class="region disabled-blocks clearfix">';
foreach ($blocks as $block) {
$output .= theme('dashboard_disabled_block', array('block' => $block));
......
......@@ -145,14 +145,14 @@ class ForumTestCase extends DrupalWebTestCase {
// Enable the active forum block.
$edit = array();
$edit['forum_active[region]'] = 'sidebar_second';
$edit['blocks[forum_active][region]'] = 'sidebar_second';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
$this->assertText(t('The block settings have been updated.'), t('Active forum topics forum block was enabled'));
// Enable the new forum block.
$edit = array();
$edit['forum_new[region]'] = 'sidebar_second';
$edit['blocks[forum_new][region]'] = 'sidebar_second';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
$this->assertText(t('The block settings have been updated.'), t('[New forum topics] Forum block was enabled'));
......
......@@ -1160,7 +1160,7 @@ class LocaleLanguageSwitchingFunctionalTest extends DrupalWebTestCase {
// Enable the language switching block.
$language_type = LANGUAGE_TYPE_INTERFACE;
$edit = array(
"locale_{$language_type}[region]" => 'sidebar_first',
"blocks[locale_{$language_type}][region]" => 'sidebar_first',
);
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
......
......@@ -157,7 +157,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Enable the custom menu block.
$menu_name = 'menu-' . $menu_name; // Drupal prepends the name with 'menu-'.
$edit = array();
$edit['menu_' . $menu_name . '[region]'] = 'sidebar_first';
$edit['blocks[menu_' . $menu_name . '][region]'] = 'sidebar_first';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
$this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled'));
......
......@@ -634,7 +634,7 @@ class NodeBlockTestCase extends DrupalWebTestCase {
// Set the block to a region to confirm block is available.
$edit = array();
$edit['node_syndicate[region]'] = 'footer';
$edit['blocks[node_syndicate][region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
}
......@@ -1398,7 +1398,7 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
// Set the block to a region to confirm block is available.
$edit = array(
'node_recent[region]' => 'sidebar_first',
'blocks[node_recent][region]' => 'sidebar_first',
);
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block saved to first sidebar region.'));
......
......@@ -265,7 +265,7 @@ class PollBlockTestCase extends PollTestCase {
// Set the block to a region to confirm block is available.
$edit = array();
$edit['poll_recent[region]'] = 'footer';
$edit['blocks[poll_recent][region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
......
......@@ -397,7 +397,7 @@ class ProfileBlockTestCase extends ProfileTestCase {
function testAuthorInformationBlock() {