diff --git a/core/authorize.php b/core/authorize.php index a18d2d8..b11387c 100644 --- a/core/authorize.php +++ b/core/authorize.php @@ -70,9 +70,6 @@ function authorize_access_allowed() { // We prepare only a minimal bootstrap. This includes the database and // variables, however, so we have access to the class autoloader. drupal_bootstrap(DRUPAL_BOOTSTRAP_VARIABLES); -// A request object from the HTTPFoundation to tell us about the request. -$request = Request::createFromGlobals(); -Drupal::getContainer()->set('request', $request); // This must go after drupal_bootstrap(), which unsets globals! global $conf; diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index c0ce1b2..a4050ba 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -184,7 +184,7 @@ public function containerBuild(ContainerBuilder $container) { $definition = $container->getDefinition('path_processor_alias'); $definition->clearTag('path_processor_inbound')->clearTag('path_processor_outbound'); } - $request = Request::createFromGlobals(); + $request = Request::create('/'); $this->container->set('request', $request); } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index ce4e867..fa6f0d1 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -1005,7 +1005,7 @@ protected function rebuildContainer() { // DrupalKernel replaces the container in Drupal::getContainer() with a // different object, so we need to replace the instance on this test class. $this->container = \Drupal::getContainer(); - // The global $user is set in TestBase::prepareEnvironment(). + // Assign User object initialized in TestBase::prepareEnvironment(). $this->container->get('request')->attributes->set('_account', $GLOBALS['user']); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php index d743b5b..af0bee7 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php @@ -885,6 +885,8 @@ public function getHandlers($type) { // If this is during form submission and there are temporary options // which can only appear if the view is in the edit cache, use those // options instead. This is used for AJAX multi-step stuff. + // @todo Remove dependency on Request object + // https://drupal.org/node/2059003 try { $request = \Drupal::request(); if ($request->get('form_id') && isset($this->view->temporary_options[$type][$id])) {