diff --git c/core/authorize.php w/core/authorize.php index ae53628..8a76fe4 100644 --- c/core/authorize.php +++ w/core/authorize.php @@ -20,8 +20,6 @@ * @link authorize Authorized operation helper functions @endlink */ -use Symfony\Component\HttpFoundation\Request; - // Change the directory to the Drupal root. chdir('..'); @@ -73,9 +71,6 @@ function authorize_access_allowed() { // variables, however, so we have access to the class autoloader. drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES); -$request = Request::createFromGlobals(); -Drupal::getContainer()->set('request', $request); - // This must go after drupal_bootstrap(), which unsets globals! global $conf; @@ -141,8 +136,8 @@ function authorize_access_allowed() { $output .= theme('item_list', array('items' => $links, 'title' => t('Next steps'))); } // If a batch is running, let it run. - elseif ($request->query->has('batch')) { - $output = _batch_page($request); + elseif (isset($_GET['batch'])) { + $output = _batch_page(); } else { if (empty($_SESSION['authorize_operation']) || empty($_SESSION['authorize_filetransfer_info'])) { diff --git c/core/includes/batch.inc w/core/includes/batch.inc index 32cd8eb..569ce58 100644 --- c/core/includes/batch.inc +++ w/core/includes/batch.inc @@ -16,27 +16,23 @@ use Drupal\Core\Batch\Percentage; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RedirectResponse; /** * Renders the batch processing page based on the current state of the batch. * - * @param \Symfony\Component\HttpFoundation\Request $request - * The current request object. - * * @see _batch_shutdown() */ -function _batch_page(Request $request) { +function _batch_page() { $batch = &batch_get(); - if (!($request_id = $request->get('id'))) { + if (!isset($_REQUEST['id'])) { return FALSE; } // Retrieve the current state of the batch. if (!$batch) { - $batch = Drupal::service('batch.storage')->load($request_id); + $batch = Drupal::service('batch.storage')->load($_REQUEST['id']); if (!$batch) { drupal_set_message(t('No active batch.'), 'error'); return new RedirectResponse(url('', array('absolute' => TRUE))); @@ -55,7 +51,7 @@ function _batch_page(Request $request) { } } - $op = $request->get('op', ''); + $op = isset($_REQUEST['op']) ? $_REQUEST['op'] : ''; $output = NULL; switch ($op) { case 'start': diff --git c/core/includes/install.core.inc w/core/includes/install.core.inc index b8212d2..0a2cb29 100644 --- c/core/includes/install.core.inc +++ w/core/includes/install.core.inc @@ -652,7 +652,7 @@ function install_run_task($task, &$install_state) { // any output from the batch process, until the task is complete. elseif ($current_batch == $function) { include_once __DIR__ . '/batch.inc'; - $output = _batch_page(Drupal::request()); + $output = _batch_page(); // Because Batch API now returns a JSON response for intermediary steps, // but the installer doesn't handle Response objects yet, just send the // output here and emulate the old model. diff --git c/core/modules/system/lib/Drupal/system/Controller/BatchController.php w/core/modules/system/lib/Drupal/system/Controller/BatchController.php index 53e8823..718fec4 100644 --- c/core/modules/system/lib/Drupal/system/Controller/BatchController.php +++ w/core/modules/system/lib/Drupal/system/Controller/BatchController.php @@ -27,7 +27,7 @@ class BatchController { */ public function batchPage(Request $request) { require_once DRUPAL_ROOT . '/core/includes/batch.inc'; - $output = _batch_page($request); + $output = _batch_page(); if ($output === FALSE) { throw new AccessDeniedHttpException(); diff --git c/core/update.php w/core/update.php index 7a094cc..ac36b2a 100644 --- c/core/update.php +++ w/core/update.php @@ -432,8 +432,6 @@ function update_check_requirements($skip_warnings = FALSE) { } } -// @todo Refactor this. - // Some unavoidable errors happen because the database is not yet up-to-date. // Our custom error handler is not yet installed, so we just suppress them. ini_set('display_errors', FALSE); @@ -454,8 +452,11 @@ function update_check_requirements($skip_warnings = FALSE) { drupal_session_initialize(); // A request object from the HTTPFoundation to tell us about the request. +// @todo These two lines were copied from index.php which has its own todo about +// a change required here. Revisit this when that change has been made. $request = Request::createFromGlobals(); -Drupal::getContainer()->set('request', $request); +drupal_container() + ->set('request', $request); // Ensure that URLs generated for the home and admin pages don't have 'update.php' // in them. @@ -554,7 +555,7 @@ function update_check_requirements($skip_warnings = FALSE) { // Regular batch ops : defer to batch processing API. default: update_task_list('run'); - $output = _batch_page($request); + $output = _batch_page(); break; } }