facets_exposed_filters doesn't work well with exposed filters from the view

Created on 14 November 2024, 3 months ago

Problem/Motivation

Let's say we need to select a facet filter value by default. This approach works well with views:

```
function hook_views_pre_build(ViewsExecutable $view) {
$exposed = $view->getExposedInput();
$exposed['field_test']['25'] = 25; // // sets 25 as the default active value
$view->setExposedInput($exposed);
}
```

However, after debugging facets_exposed_filters, I noticed it only considers filters/values passed in the $_GET URL parameter: https://git.drupalcode.org/project/facets/-/blob/3.0.x/modules/facets_ex... . And, of course, this doesn’t work when AJAX is enabled.

Ideally, it should also take into account parameters from $view->getExposedInput()

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024