Skip to content
Snippets Groups Projects

Issue #3052574: Facets with AJAX not working in most of situations

@@ -10,12 +10,13 @@ use Drupal\Core\Block\Plugin\Block\Broken;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Path\CurrentPathStack;
use Drupal\Core\PathProcessor\PathProcessorManager;
use Drupal\Core\Http\RequestStack as DrupalRequestStack;
use Drupal\Core\Render\RendererInterface;
use Drupal\Core\Routing\CurrentRouteMatch;
use Drupal\facets\Plugin\Block\FacetBlock;
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;
@@ -137,7 +138,15 @@ class FacetBlockAjaxController extends ControllerBase {
}
$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);
$this->currentPath->setPath($processed);
Loading