Verified Commit 24fb26f2 authored by godotislate's avatar godotislate
Browse files

task: #3453216 Clean up outdated mentions of prepareLegacyRequest

By: andypost
By: longwave
By: smustgrave
By: godotislate
parent 7a031e39
Loading
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -503,9 +503,7 @@ function install_begin_request($class_loader, &$install_state): void {
  // Load all modules and perform request related initialization.
  $kernel->preHandle($request);

  // Initialize a route on this legacy request similar to
  // \Drupal\Core\DrupalKernel::prepareLegacyRequest() since normal routing
  // will not happen.
  // A route is required for route matching.
  $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, new Route('<none>'));
  $request->attributes->set(RouteObjectInterface::ROUTE_NAME, '<none>');

+11 −0
Original line number Diff line number Diff line
@@ -995,11 +995,17 @@ protected function initializeContainer() {
    $all_messages = [];
    $config_is_syncing = FALSE;
    $source_storage = NULL;
    $stream_wrappers_registered = FALSE;
    if (isset($this->container)) {
      // Save the id of the currently logged in user.
      if ($this->container->initialized('current_user')) {
        $current_user_id = $this->container->get('current_user')->id();
      }

      if ($this->container->initialized('stream_wrapper_manager') && !empty($this->container->get('stream_wrapper_manager')->getWrappers())) {
        $stream_wrappers_registered = TRUE;
      }

      // After rebuilding the container some objects will have stale services.
      // Record a map of objects to service IDs prior to rebuilding the
      // container in order to ensure
@@ -1062,6 +1068,11 @@ protected function initializeContainer() {
      $this->container->get('session')->start();
    }

    if ($stream_wrappers_registered) {
      // Re-register the stream wrappers with the manager service.
      $this->container->get('stream_wrapper_manager')->register();
    }

    // The request stack is preserved across container rebuilds. Re-inject the
    // new session into the main request if one was present before.
    if (($request_stack = $this->container->get('request_stack', ContainerInterface::NULL_ON_INVALID_REFERENCE))) {
+0 −7
Original line number Diff line number Diff line
@@ -532,16 +532,9 @@ protected function rebuildAll() {
    // Reset/rebuild all data structures after enabling the modules, primarily
    // to synchronize all data structures and caches between the test runner and
    // the child site.
    // @see \Drupal\Core\DrupalKernel::bootCode()
    // @todo Test-specific setUp() methods may set up further fixtures; find a
    //   way to execute this after setUp() is done, or to eliminate it entirely.
    $this->resetAll();

    // Explicitly call register() again on the container registered in \Drupal.
    // @todo This should already be called through
    //   DrupalKernel::prepareLegacyRequest() -> DrupalKernel::boot() but that
    //   appears to be calling a different container.
    $this->container->get('stream_wrapper_manager')->register();
  }

  /**
+0 −6
Original line number Diff line number Diff line
@@ -519,12 +519,6 @@ public function installDrupal(): void {
    // Clear the static cache so that subsequent cache invalidations will work
    // as expected.
    $this->container->get('cache_tags.invalidator')->resetChecksums();

    // Explicitly call register() again on the container registered in \Drupal.
    // @todo This should already be called through
    //   DrupalKernel::prepareLegacyRequest() -> DrupalKernel::boot() but that
    //   appears to be calling a different container.
    $this->container->get('stream_wrapper_manager')->register();
  }

  /**