### Eclipse Workspace Patch 1.0 #P drupal 7 Index: includes/common.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/common.inc,v retrieving revision 1.1168 diff -u -r1.1168 common.inc --- includes/common.inc 19 May 2010 19:22:24 -0000 1.1168 +++ includes/common.inc 20 May 2010 13:16:27 -0000 @@ -152,49 +152,6 @@ define('DRUPAL_CACHE_GLOBAL', 0x0008); /** - * Add content to a specified region. - * - * @param $region - * Page region the content is added to. - * @param $data - * Content to be added. - */ -function drupal_add_region_content($region = NULL, $data = NULL) { - static $content = array(); - - if (!is_null($region) && !is_null($data)) { - $content[$region][] = $data; - } - return $content; -} - -/** - * Get assigned content for a given region. - * - * @param $region - * A specified region to fetch content for. If NULL, all regions will be - * returned. - * @param $delimiter - * Content to be inserted between imploded array elements. - */ -function drupal_get_region_content($region = NULL, $delimiter = ' ') { - $content = drupal_add_region_content(); - if (isset($region)) { - if (isset($content[$region]) && is_array($content[$region])) { - return implode($delimiter, $content[$region]); - } - } - else { - foreach (array_keys($content) as $region) { - if (is_array($content[$region])) { - $content[$region] = implode($delimiter, $content[$region]); - } - } - return $content; - } -} - -/** * Get the name of the currently active install profile. * * When this function is called during Drupal's initial installation process, @@ -4651,7 +4608,7 @@ /** * Returns information about system object files (modules, themes, etc.). - * + * * This function is used to find all or some system object files (module files, * theme files, etc.) that exist on the site. It searches in several locations, * depending on what type of object you are looking for. For instance, if you Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.598 diff -u -r1.598 theme.inc --- includes/theme.inc 19 May 2010 19:22:24 -0000 1.598 +++ includes/theme.inc 20 May 2010 13:16:27 -0000 @@ -2362,13 +2362,10 @@ global $theme; // Retrieve the theme data to list all available regions. $theme_data = list_themes(); - $regions = $theme_data[$theme]->info['regions']; - - // Get all region content set with drupal_add_region_content(). - foreach (array_keys($regions) as $region) { - // Assign region to a region variable. - $region_content = drupal_get_region_content($region); - isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content; + foreach ($theme_data[$theme]->info['regions'] as $region => $region_info) { + if (!isset($variables[$region])) { + $variables[$region] = ''; + } } // Setup layout variable. Index: includes/install.core.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/install.core.inc,v retrieving revision 1.19 diff -u -r1.19 install.core.inc --- includes/install.core.inc 18 May 2010 18:11:13 -0000 1.19 +++ includes/install.core.inc 20 May 2010 13:16:27 -0000 @@ -691,6 +691,8 @@ */ function install_display_output($output, $install_state) { drupal_page_header(); + + $build = array('content' => $output); // Only show the task list if there is an active task; otherwise, the page // request has ended before tasks have even been started, so there is nothing // meaningful to show. @@ -698,9 +700,9 @@ // Let the theming function know when every step of the installation has // been completed. $active_task = $install_state['installation_finished'] ? NULL : $install_state['active_task']; - drupal_add_region_content('sidebar_first', theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task))); + $build['sidebar_first'] = theme('task_list', array('items' => install_tasks_to_display($install_state), 'active' => $active_task)); } - print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', array('content' => $output)); + print theme($install_state['database_tables_exist'] ? 'maintenance_page' : 'install_page', $build); exit; } Index: modules/simpletest/tests/common.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v retrieving revision 1.112 diff -u -r1.112 common.test --- modules/simpletest/tests/common.test 18 May 2010 06:59:46 -0000 1.112 +++ modules/simpletest/tests/common.test 20 May 2010 13:16:27 -0000 @@ -101,13 +101,13 @@ $class = $this->randomName(); $link = l($this->randomName(), $_GET['q'], array('attributes' => array('class' => array($class)))); $this->assertTrue($this->hasClass($link, $class), t('Custom class @class is present on link when requested', array('@class' => $class))); - $this->assertTrue($this->hasClass($link, 'active'), t('Class @class is present on link to the current page', array('@class' => 'active'))); + $this->assertTrue($this->hasClass($link, 'active'), t('Class @class is present on link to the current page', array('@class' => 'active'))); } private function hasClass($link, $class) { return preg_match('|class="([^\"\s]+\s+)*' . $class . '|', $link); } - + /** * Test drupal_get_query_parameters(). */ @@ -932,52 +932,6 @@ } /** - * Testing drupal_add_region_content and drupal_get_region_content. - */ -class DrupalSetContentTestCase extends DrupalWebTestCase { - public static function getInfo() { - return array( - 'name' => 'Drupal set/get regions', - 'description' => 'Performs tests on setting and retrieiving content from theme regions.', - 'group' => 'System' - ); - } - - - /** - * Test setting and retrieving content for theme regions. - */ - function testRegions() { - global $theme_key; - - $block_regions = array_keys(system_region_list($theme_key)); - $delimiter = $this->randomName(32); - $values = array(); - // Set some random content for each region available. - foreach ($block_regions as $region) { - $first_chunk = $this->randomName(32); - drupal_add_region_content($region, $first_chunk); - $second_chunk = $this->randomName(32); - drupal_add_region_content($region, $second_chunk); - // Store the expected result for a drupal_get_region_content call for this region. - $values[$region] = $first_chunk . $delimiter . $second_chunk; - } - - // Ensure drupal_get_region_content returns expected results when fetching all regions. - $content = drupal_get_region_content(NULL, $delimiter); - foreach ($content as $region => $region_content) { - $this->assertEqual($region_content, $values[$region], t('@region region text verified when fetching all regions', array('@region' => $region))); - } - - // Ensure drupal_get_region_content returns expected results when fetching a single region. - foreach ($block_regions as $region) { - $region_content = drupal_get_region_content($region, $delimiter); - $this->assertEqual($region_content, $values[$region], t('@region region text verified when fetching single region.', array('@region' => $region))); - } - } -} - -/** * Testing drupal_goto and hook_drupal_goto_alter(). */ class DrupalGotoTest extends DrupalWebTestCase { Index: update.php =================================================================== RCS file: /cvs/drupal/drupal/update.php,v retrieving revision 1.323 diff -u -r1.323 update.php --- update.php 18 May 2010 18:11:12 -0000 1.323 +++ update.php 20 May 2010 13:16:26 -0000 @@ -31,11 +31,7 @@ function update_selection_page() { drupal_set_title('Drupal database update'); $elements = drupal_get_form('update_script_selection_form'); - $output = drupal_render($elements); - - update_task_list('select'); - - return $output; + return drupal_render($elements); } function update_script_selection_form($form, &$form_state) { @@ -150,7 +146,6 @@ drupal_set_title('Drupal database update'); $links = update_helpful_links(); - update_task_list(); // Report end result. if (module_exists('dblog')) { $log_message = ' All errors have been logged.'; @@ -223,7 +218,6 @@ cache_clear_all('*', 'cache_update', TRUE); } - update_task_list('info'); drupal_set_title('Drupal database update'); $token = drupal_get_token('update'); $output = '

Use this utility to update your database whenever a new release of Drupal or a module is installed.

For more detailed information, see the upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.

'; @@ -289,7 +283,7 @@ 'finished' => 'Review log', ); - drupal_add_region_content('sidebar_first', theme('task_list', array('items' => $tasks, 'active' => $active))); + return theme('task_list', array('items' => $tasks, 'active' => $active)); } /** @@ -315,11 +309,10 @@ // If there are issues, report them. if ($severity == REQUIREMENT_ERROR) { - update_task_list('requirements'); drupal_set_title('Requirements problem'); $status_report = theme('status_report', array('requirements' => $requirements)); $status_report .= 'Check the error messages and try again.'; - print theme('update_page', array('content' => $status_report)); + print theme('update_page', array('content' => $status_report, 'sidebar_first' => update_task_list('requirements'))); exit(); } } @@ -404,6 +397,7 @@ case 'selection': if (isset($_GET['token']) && $_GET['token'] == drupal_get_token('update')) { + $tasks = update_task_list('select'); $output = update_selection_page(); break; } @@ -415,16 +409,18 @@ } case 'info': + $tasks = update_task_list('info'); $output = update_info_page(); break; case 'results': + $tasks = update_task_list(); $output = update_results_page(); break; // Regular batch ops : defer to batch processing API. default: - update_task_list('run'); + $tasks = update_task_list('run'); $output = _batch_page(); break; } @@ -435,7 +431,12 @@ if (isset($output) && $output) { // Explictly start a session so that the update.php token will be accepted. drupal_session_start(); - // We defer the display of messages until all updates are done. - $progress_page = ($batch = batch_get()) && isset($batch['running']); - print theme('update_page', array('content' => $output, 'show_messages' => !$progress_page)); + $build = array( + 'content' => $output, + 'sidebar_first' => $tasks, + // We defer the display of messages until all updates are done. + 'show_messages' => !(($batch = batch_get()) && isset($batch['running'])), + ); + + print theme('update_page', $build); }