- Issue created by @3li
Same problem here. Using std checkboxes it's working but not with Select2.
- π¬π§United Kingdom 3li U.K. π¬π§
Think I found the problem.
We should be running an extra processfacets_exposed_filter_remove_validation
(facets/modules/facets_exposed_filters/src/Plugin/views/FacetsViewsPluginTrait.php) which is meant tounset($element["#needs_validation"]);
However for some reason when using select2 nothing gets created and thus this process does not get attached or run, meaning that validation is still enabled.
- πΊπΈUnited States DamienMcKenna NH, USA
Bumping this to major as it affects this basic functionality from working as expected.
- π§πͺBelgium StryKaizer Belgium
Core Views renders its "exposed form" before it fires the query.
Because how facets work, we only know the values after the query has been executed.
Thats why we re-render the exposed form again a second time.That's why, if you are debugging, the first time you'll see an empty #options list, which is re-rendered the second time.
I dont have time to debug the select2 implementation, but this info could help somebody debugging it ;)
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
I have the same issue when using only facets + views + exposing sorting options in the view.
Not using select2, nor Facets exposed filters (Experimental).
The results are sorted as expected, just the warning is there. - πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
My sort fields were called "name" and "changed".
Debugging this I found that the valid values were "title", "z_date" and "relevance", but not sure where this keys are coming from.
Might be a different issue than the one you are having. - π§π·Brazil edmargomes
If I use select2 in BEF then I have the same problem.
But, if I keep the default value widget or checkbox, worked
Then, I made a test, I changed select to select2 in FacetFilter line 174
$form['value'] = [ '#type' => 'select2', '#options' => $this->buildOptions($facet->getResults(), $facet), '#multiple' => $this->options["expose"]["multiple"], '#process' => array_merge($select_element["#process"], ['facets_exposed_filters_remove_validation']), ];
This worked too
I tried form alter and add this:
$form['city']['#type'] = 'select2';
But show the same problem, only worked in valueForm on FacetFilter
I am searching for Drupal away solution yet
- π§π·Brazil edmargomes
I fixed my problem with this:
I created a form alter and added
if ($form_id == 'views_exposed_form' && $form['#id'] == 'views-exposed-form-faros-companies-search-search-companies-block') { if (isset($form['city']['#process'])) $form['city']['#process'] = array_merge($form['city']["#process"], ['facets_exposed_filters_remove_validation']); }
- π§πͺBelgium StryKaizer Belgium
@edmargomes can you please let me know which exact facets3 version you are using?
Since beta3, I dont think adding this function should matter anymore, and I was thinking about removing that part entirely.
- πΊπΈUnited States ethomas08 SF Bay Area
I am experiencing this bug and just upgraded to the beta4 release for the facets module. Using the select2 widget setting with BEF.
- πͺπΈSpain penyaskito Seville π, Spain πͺπΈ, UTC+2 πͺπΊ
In my case, described in #7 and #8, I discovered my issue is that I had two different exposed blocks with (different) exposed sorting options in the same page. As both use "sort_by" and "sort_order", one of them is gonna parse wrong values and throw that error.
I've created β¨ Views exposed sort identifiers are not configurable when also exposed Active in core that fixed it for me. Also β¨ Allow exposed form to preserve URL query parameters Postponed: needs info to be able to use this in BEF. So at the end it wasn't facets related.