diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 958e0e5..160b841 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -421,7 +421,7 @@ function install_begin_request(&$install_state) { // checked by other subsystems (e.g., the theme system). $module_handler->loadAll(); - $kernel->prepareLegacyRequest($request); + $kernel->prepareLegacyRequest($request, FALSE); // Prepare for themed output. We need to run this at the beginning of the // page request to avoid a different theme accidentally getting set. (We also diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 360fc46..7696606 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -566,12 +566,14 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = /** * {@inheritdoc} */ - public function prepareLegacyRequest(Request $request) { + public function prepareLegacyRequest(Request $request, $use_session = TRUE) { $this->boot(); $this->preHandle($request); // Setup services which are normally initialized from within stack // middleware or during the request kernel event. - $request->setSession($this->container->get('session')); + if ($use_session) { + $request->setSession($this->container->get('session')); + } $this->container->get('request_stack')->push($request); $this->container->get('router.request_context')->fromRequest($request); return $this; diff --git a/core/lib/Drupal/Core/DrupalKernelInterface.php b/core/lib/Drupal/Core/DrupalKernelInterface.php index a5eb3b9..082c3f0 100644 --- a/core/lib/Drupal/Core/DrupalKernelInterface.php +++ b/core/lib/Drupal/Core/DrupalKernelInterface.php @@ -101,13 +101,15 @@ public function handlePageCache(Request $request); * * @param \Symfony\Component\HttpFoundation\Request $request * The current request. + * @param bool $use_session + * Whether or not the session should accessible from the request. * * @return $this * * @deprecated 8.x * Only used by legacy front-controller scripts. */ - public function prepareLegacyRequest(Request $request); + public function prepareLegacyRequest(Request $request, $use_session); /** * Helper method that does request related initialization.