Skip to content
Snippets Groups Projects
Commit dbb7ed45 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by Markus Kalkbrenner
Browse files

Issue #3294561 by mkalkbrenner: Require Drupal >=9.3

parent a64eb6fa
No related branches found
No related tags found
No related merge requests found
......@@ -51,9 +51,7 @@ class ResetFacetsProcessor extends ProcessorPluginBase implements BuildProcessor
}
$request_stack = \Drupal::requestStack();
// Support 9.3+.
// @todo remove switch after 9.3 or greater is required.
$request = version_compare(\Drupal::VERSION, '9.3', '>=') ? $request_stack->getMainRequest() : $request_stack->getMasterRequest();
$request = $request_stack->getMainRequest();
$query_params = $request->query->all();
// Bypass all active facets and remove them from the query parameters array.
......
......@@ -127,15 +127,8 @@ class FacetBlockAjaxController extends ControllerBase {
$facets_blocks = array_unique($facets_blocks);
$new_request = Request::create($path);
// 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();
}
$request_stack = new DrupalRequestStack();
$processed = $this->pathProcessor->processInbound($path, $new_request);
$processed_request = Request::create($processed);
......
......@@ -25,9 +25,7 @@ abstract class HierarchyPluginBase extends ProcessorPluginBase implements Hierar
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$request_stack = $container->get('request_stack');
// Support 9.3+.
// @todo remove switch after 9.3 or greater is required.
$request = version_compare(\Drupal::VERSION, '9.3', '>=') ? $request_stack->getMainRequest() : $request_stack->getMasterRequest();
$request = $request_stack->getMainRequest();
return new static($configuration, $plugin_id, $plugin_definition, $request);
}
......
......@@ -124,9 +124,7 @@ class SearchApiDisplay extends FacetSourcePluginBase implements SearchApiFacetSo
$container->get('plugin.manager.facets.query_type'),
$container->get('search_api.query_helper'),
$container->get('plugin.manager.search_api.display'),
// Support 9.3+.
// @todo remove switch after 9.3 or greater is required.
version_compare(\Drupal::VERSION, '9.3', '>=') ? $request_stack->getMainRequest() : $request_stack->getMasterRequest(),
$request_stack->getMainRequest(),
$container->get('module_handler')
);
}
......
......@@ -85,9 +85,7 @@ trait BlockTestTrait {
* The id of the block.
*/
protected function deleteBlock($id) {
// Delete a facet block through the UI, the text for the success message has
// changed in Drupal::VERSION 9.3.
$orig_success_message = 'The block ' . $this->blocks[$id]->label() . ' has been removed' . (\Drupal::VERSION >= 9.3 ? ' from the Footer region' : '') . '.';
$orig_success_message = 'The block ' . $this->blocks[$id]->label() . ' has been removed from the Footer region.';
$this->drupalGet('admin/structure/block/manage/' . $this->blocks[$id]->id(), ['query' => ['destination' => 'admin']]);
$this->clickLink('Remove block');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment