Problem/Motivation

The QueryString URL processor provides an event "facets.query_string_created" to change the URL of each facet filter with an EventSubscriber. However, the changes are not picked up in QueryString::buildUrls() method, so no changes are possible.

Proposed resolution

In \Drupal\facets\Plugin\facets\url_processor\QueryString :

Replace :

$this->eventDispatcher->dispatch(QueryStringCreated::NAME, new QueryStringCreated($result_get_params, $filter_params, $result, $this->activeFilters, $facet));

By :

$event = new QueryStringCreated($result_get_params, $filter_params, $result, $this->activeFilters, $facet);
$this->eventDispatcher->dispatch(QueryStringCreated::NAME, $event);
$filter_params = $event->getFilterParameters();

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ericbellot created an issue. See original summary.

ericbellot’s picture

borisson_’s picture

Patch doesn't apply to the latest dev?

Megha_kundar’s picture

Status: Active » Needs review
FileSize
927 bytes

since previous applied patch was failing applied new ported patch for latest dev.

borisson_’s picture

Status: Needs review » Needs work

The indentation in #4 is only 5 spaces but should be 6, according to phpcs.

Megha_kundar’s picture

Assigned: Unassigned » Megha_kundar
Megha_kundar’s picture

Status: Needs work » Needs review
FileSize
930 bytes

Updated patch with phpcs fix

Megha_kundar’s picture

Assigned: Megha_kundar » Unassigned
Status: Needs review » Needs work
Megha_kundar’s picture

Status: Needs work » Needs review

changing status to needs review.

joekers’s picture

Status: Needs review » Reviewed & tested by the community

This patch is working for me - thanks.

mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks for your help!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.