The range slider directly alters the url, instead of using the active items, which breaks pretty paths.

Got following error using facets range widget
Notice: Undefined index: f in Drupal\facets_range_widget\Plugin\facets\processor\RangeSliderProcessor->build() (line 58 of modules/contrib/facets/modules/facets_range_widget/src/Plugin/facets/processor/RangeSliderProcessor.php).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

a.sinitsa created an issue. See original summary.

StryKaizer’s picture

Title: Usage with facets range widget » Facets range widget directly alters the url
Project: Facets Pretty Paths » Facets
Issue summary: View changes
StryKaizer’s picture

Status: Active » Needs review
FileSize
1.91 KB
borisson_’s picture

FileSize
1.97 KB
3.88 KB

Fixes the tests.

borisson_’s picture

@StryKaizer, does this fix pretty paths?

  • borisson_ committed f346b9f on 8.x-1.x
    Issue #2974512 by borisson_, StryKaizer: Facets range widget directly...
borisson_’s picture

Status: Needs review » Fixed

Asked this on slack, this does fix pretty paths, committed!

Status: Fixed » Closed (fixed)

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

5n00py’s picture

+++ b/modules/facets_range_widget/src/Plugin/facets/processor/RangeSliderProcessor.php
@@ -46,25 +46,15 @@ class RangeSliderProcessor extends SliderProcessor implements PreQueryProcessorI
+      $new_active_filters[$facet->getUrlAlias()][] = '(min:__range_slider_min__,max:__range_slider_max__)';
+      $url = \Drupal::service('facets.utility.url_generator')->getUrl($new_active_filters, FALSE);

getUrl use keys to determine facet id's, not aliases

It should be:

$new_active_filters[$facet->id()][] = '(min:__range_slider_min__,max:__range_slider_max__)';

@borisson_ Can you commit this change? Its related and very small to create new issue/patch.

borisson_’s picture

Can you open a new issue anyway? I would love to commit this, but I can't (at work right now), I hope to find time next weekend to look at committing this and I will have forgotten about this issue.

StryKaizer’s picture

I can confirm @5n00py's code is correct, so yes, it should be changed, but please create another issue ;)

5n00py’s picture

Thanks for fast response, follow-up created:
#2994859: Fix range slider processor's url generation