All facet options marked as active when showing reset all option

Created on 6 October 2022, about 2 years ago
Updated 10 July 2024, 5 months ago

Problem/Motivation

#3291943: When rendering facets on non search page, it throws error instead of 404 on 404 pages β†’ caused a pretty strange regression. That changed the reset all url in /home/sgr/Projekte/primer/psi.ch/web/modules/contrib/facets/src/Plugin/facets/widget/LinksWidget.php:41 to use \Drupal\facets\Utility\FacetsUrlGenerator::getUrlForRequest and then alters that url object.

But \Drupal\facets\Utility\FacetsUrlGenerator::getUrlForRequest() uses a static cache for performance, so it apparently really alters the query string and options for all Url Objects used in that render array.

I'm not 100% sure why it isn't more broken and there might be more going on, but adding a clone there seems to fix that problem. \Drupal\facets\Plugin\facets\url_processor\QueryString::buildUrls does a lot of cloning already.

Steps to reproduce

Proposed resolution

clone the url object before altering it.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024