Commit 28ccbe93 authored by James Gilliland's avatar James Gilliland Committed by Markus Kalkbrenner
Browse files

Issue #3253542 by RandalV, neclimdul, mkalkbrenner, catch:...

Issue #3253542 by RandalV, neclimdul, mkalkbrenner, catch: FacetBlockAjaxController breaks the RequestStack in Drupal 9.3.0
parent fd466a11
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -6,13 +6,14 @@ use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\InvokeCommand;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Http\RequestStack as DrupalRequestStack;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\PathProcessor\PathProcessorManager;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Routing\CurrentRouteMatch;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpFoundation\RequestStack as SymfonyRequestStack;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\RouterInterface;

@@ -126,7 +127,15 @@ class FacetBlockAjaxController extends ControllerBase {
    $facets_blocks = array_unique($facets_blocks);

    $new_request = Request::create($path);
    $request_stack = new RequestStack();
    // Support 9.3+
    // @todo remove after 9.3 or greater is required.
    if (class_exists(DrupalRequestStack::class)) {
      $request_stack = new DrupalRequestStack();
    }
    // Legacy request stack.
    else {
      $request_stack = new SymfonyRequestStack();
    }
    $processed = $this->pathProcessor->processInbound($path, $new_request);

    $this->currentPath->setPath($processed);