Commit c584df53 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by Markus Kalkbrenner
Browse files

Issue #3257441 by idebr, mkalkbrenner: Calling the...

Issue #3257441 by idebr, mkalkbrenner: Calling the EventDispatcherInterface::dispatch() method with a string event name as the first argument is deprecated
parent 46f666ba
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
<?php

namespace Drupal\facets\Event;

/**
 * Defines events for the Facets module.
 */
final class FacetsEvents {

  /**
   * This event allows modules to change the facet's query string if needed.
   *
   * @Event
   *
   * @see \Drupal\facets\Event\QueryStringCreated
   */
  public const QUERY_STRING_CREATED = QueryStringCreated::class;

}
+5 −2
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ namespace Drupal\facets\Event;

use Drupal\facets\FacetInterface;
use Drupal\facets\Result\ResultInterface;
use Symfony\Component\EventDispatcher\Event;
use Drupal\Component\EventDispatcher\Event;
use Symfony\Component\HttpFoundation\ParameterBag;

/**
@@ -14,7 +14,10 @@ use Symfony\Component\HttpFoundation\ParameterBag;
 */
final class QueryStringCreated extends Event {

  const NAME = 'facets.query_string_created';
  /**
   * @deprecated use FacetsEvents::QUERY_STRING_CREATED instead
   */
  public const NAME = FacetsEvents::QUERY_STRING_CREATED;

  /**
   * The get parameters.
+1 −1
Original line number Diff line number Diff line
@@ -198,7 +198,7 @@ class QueryString extends UrlProcessorPluginBase {

      // Allow other modules to alter the result url built.
      $event = new QueryStringCreated($result_get_params, $filter_params, $result, $this->activeFilters, $facet);
      $this->eventDispatcher->dispatch(QueryStringCreated::NAME, $event);
      $this->eventDispatcher->dispatch($event);
      $filter_params = $event->getFilterParameters();

      asort($filter_params, \SORT_NATURAL);