If the JSON:API Search API Facets module is enabled and you want to add a facet to a view facet source, only the 'JSON:API Search API' widget is available:

Expected:

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

introfini created an issue. See original summary.

introfini’s picture

The problem is here, there's no check for the facet source type:

/**
 * Implements hook_form_FORM_ID_alter().
 */
function jsonapi_search_api_facets_form_facets_facet_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  foreach ($form['widget']['#options'] as $plugin_id => $plugin_name) {
    if (strpos($plugin_id, 'jsonapi_') !== 0) {
      unset($form['widget']['#options'][$plugin_id]);
    }
  }

introfini’s picture

Status: Active » Needs review
jksloan2974’s picture

It looks like issue that was "fixed", removed all the widgets. The question is why (if the JSON:API Search API Facets is enabled) would you need/want to remove all other widget options.

https://www.drupal.org/project/jsonapi_search_api/issues/3171391

edmonkey’s picture

+1 to get this resolved, is rather critical! Any workarounds/patches out there?

jsacksick’s picture

Status: Needs review » Fixed

@introfini: Thanks for your patch! Committed!

  • jsacksick committed bed13f63 on 8.x-1.x authored by introfini
    Issue #3209092 by introfini: Facets: No other widgets options are...

Status: Fixed » Closed (fixed)

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