Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#7 | 3182988-6.patch | 930 bytes | Megha_kundar |
#4 | 3182988-4.patch | 927 bytes | Megha_kundar |
#2 | The_QueryStringCreated_event_dispatcher_does_not_work-3182988.patch | 929 bytes | ericbellot |
Comments
Comment #2
ericbellot CreditAttribution: ericbellot for Carrefour commentedComment #3
borisson_Patch doesn't apply to the latest dev?
Comment #4
Megha_kundar CreditAttribution: Megha_kundar commentedsince previous applied patch was failing applied new ported patch for latest dev.
Comment #5
borisson_The indentation in #4 is only 5 spaces but should be 6, according to phpcs.
Comment #6
Megha_kundar CreditAttribution: Megha_kundar commentedComment #7
Megha_kundar CreditAttribution: Megha_kundar commentedUpdated patch with phpcs fix
Comment #8
Megha_kundar CreditAttribution: Megha_kundar commentedComment #9
Megha_kundar CreditAttribution: Megha_kundar commentedchanging status to needs review.
Comment #10
joekersThis patch is working for me - thanks.
Comment #12
mkalkbrennerCommitted, thanks for your help!