diff --git a/core/includes/update.inc b/core/includes/update.inc index f7642cd..872bd7d 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -148,14 +148,15 @@ function update_check_requirements($skip_warnings = FALSE) { // If there are errors, always display them. If there are only warnings, skip // them if the caller has indicated they should be skipped. if ($severity == REQUIREMENT_ERROR || ($severity == REQUIREMENT_WARNING && !$skip_warnings)) { - update_task_list('requirements'); + $regions['sidebar_first'] = update_task_list('requirements'); $status_report = array( '#theme' => 'status_report', '#requirements' => $requirements, ); $status_report['#suffix'] = 'Check the messages and try again.'; + drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - print DefaultHtmlPageRenderer::renderPage($status_report, 'Requirements problem'); + print DefaultHtmlPageRenderer::renderPage($status_report, 'Requirements problem', 'maintenance', $regions); exit(); } } diff --git a/core/update.php b/core/update.php index 713220f..9657ae1 100644 --- a/core/update.php +++ b/core/update.php @@ -58,8 +58,6 @@ function update_selection_page() { $build = \Drupal::formBuilder()->getForm('Drupal\Core\Update\Form\UpdateScriptSelectionForm'); $build['#title'] = 'Drupal database update'; - update_task_list('select'); - return $build; } @@ -98,8 +96,6 @@ function update_flush_all_caches() { * Displays results of the update script with any accompanying errors. */ function update_results_page() { - - update_task_list(); // Report end result. if (\Drupal::moduleHandler()->moduleExists('dblog') && user_access('access site reports')) { $log_message = ' All errors have been logged.'; @@ -201,7 +197,6 @@ function update_info_page() { $keyvalue->get('update')->deleteAll(); $keyvalue->get('update_available_release')->deleteAll(); - update_task_list('info'); $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.

'; $output .= "
    \n"; @@ -293,8 +288,7 @@ function update_task_list($active = NULL) { '#items' => $tasks, '#active' => $active, ); - - drupal_add_region_content('sidebar_first', drupal_render($task_list)); + return $task_list; } // Some unavoidable errors happen because the database is not yet up-to-date. @@ -391,6 +385,7 @@ function update_task_list($active = NULL) { // not passed through the error handler) will cause a message to be printed. ini_set('display_errors', TRUE); +$regions = array(); // Only proceed with updates if the user is allowed to run them. if (update_access_allowed()) { @@ -415,6 +410,7 @@ function update_task_list($active = NULL) { case 'selection': $token = $request->query->get('token'); if (isset($token) && drupal_valid_token($token, 'update')) { + $regions['sidebar_first'] = update_task_list('select'); $output = update_selection_page(); break; } @@ -422,6 +418,7 @@ function update_task_list($active = NULL) { case 'Apply pending updates': $token = $request->query->get('token'); if (isset($token) && drupal_valid_token($token, 'update')) { + $regions['sidebar_first'] = update_task_list('run'); // Generate absolute URLs for the batch processing (using $base_root), // since the batch API will pass them to url() which does not handle // update.php correctly by default. @@ -432,16 +429,18 @@ function update_task_list($active = NULL) { } case 'info': + $regions['sidebar_first'] = update_task_list('info'); $output = update_info_page(); break; case 'results': + $regions['sidebar_first'] = update_task_list(); $output = update_results_page(); break; // Regular batch ops : defer to batch processing API. default: - update_task_list('run'); + $regions['sidebar_first'] = update_task_list('run'); $output = _batch_page($request); break; } @@ -459,7 +458,7 @@ function update_task_list($active = NULL) { } else { drupal_add_http_header('Content-Type', 'text/html; charset=utf-8'); - print DefaultHtmlPageRenderer::renderPage($output, $output['#title'], 'maintenance', array( + print DefaultHtmlPageRenderer::renderPage($output, $output['#title'], 'maintenance', $regions + array( '#show_messages' => !$progress_page, )); }