Skip to content
Snippets Groups Projects
Commit b7afb394 authored by Christophe Goffin's avatar Christophe Goffin
Browse files

Also support Drupal 9.3+.

parent 6b339a91
No related branches found
No related tags found
No related merge requests found
...@@ -10,12 +10,13 @@ use Drupal\Core\Block\Plugin\Block\Broken; ...@@ -10,12 +10,13 @@ use Drupal\Core\Block\Plugin\Block\Broken;
use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Path\CurrentPathStack; use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\PathProcessor\PathProcessorManager; use Drupal\Core\PathProcessor\PathProcessorManager;
use Drupal\Core\Http\RequestStack as DrupalRequestStack;
use Drupal\Core\Render\RendererInterface; use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Routing\CurrentRouteMatch; use Drupal\Core\Routing\CurrentRouteMatch;
use Drupal\facets\Plugin\Block\FacetBlock; use Drupal\facets\Plugin\Block\FacetBlock;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Request; 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\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Routing\RouterInterface;
...@@ -137,7 +138,15 @@ class FacetBlockAjaxController extends ControllerBase { ...@@ -137,7 +138,15 @@ class FacetBlockAjaxController extends ControllerBase {
} }
$new_request = Request::create($path); $new_request = Request::create($path);
$request_stack = new RequestStack(); // Support 9.3+
// @todo remove after 9.3 or greater is required.
if (class_exists(\Drupal\Core\Http\RequestStack::class)) {
$request_stack = new DrupalRequestStack();
}
// Legacy request stack.
else {
$request_stack = new SymfonyRequestStack();
}
$processed = $this->pathProcessor->processInbound($path, $new_request); $processed = $this->pathProcessor->processInbound($path, $new_request);
$this->currentPath->setPath($processed); $this->currentPath->setPath($processed);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment