Hello,

The widget works great for normal search pages but is not working when added to a panel. The default widget is shown instead.

Not sure if this is something that can be easily fixed.

Kind regards,

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

mellowtothemax created an issue. See original summary.

cosolom’s picture

Status: Active » Closed (outdated)
smulvih2’s picture

Version: 7.x-1.x-dev » 1.0.0-beta4
Status: Closed (outdated) » Active

I am having the same issue in Drupal 10 with version 1.0.0-beta4. I can get it working on a view with a page display, but not for a panel page with a search view block display. I can see the block is printing (somewhat), but nothing is visible:

<form id="search-api-sorts-widget-widget--2" method="post" action="/en/search" data-drupal-selector="search-api-sorts-widget-widget-2" data-once="form-updated" data-drupal-form-fields="">
  
<input value="form-tnZMjD-CtIC1IwKZaVwCH6tueNmkNMW8VTC7Nj_oEYY" name="form_build_id" type="hidden" data-drupal-selector="form-tnzmjd-ctic1iwkzavwch6tuenmknmw8vtc7nj-oeyy">

<input value="YIWYPIUNpHQjlX3AqvQlPuqIUwKhYkiW65umIzR5Mt8" name="form_token" type="hidden" class="form-control" data-drupal-selector="edit-search-api-sorts-widget-widget-form-token-2">

<input value="search_api_sorts_widget_widget" name="form_id" type="hidden" data-drupal-selector="edit-search-api-sorts-widget-widget-2">

</form>
peri22’s picture

Version: 1.0.0-beta4 » 1.x-dev

peri22’s picture

Status: Active » Needs review

The empty form is generated by the widget: even when the sorts block has nothing to display, it still wraps the empty content in a
tag. MR !13 prevents rendering the form in this case and includes a kernel test to cover it.
The sorts themselves remain hidden on Panels pages because Search API does not detect views blocks placed there (ViewsBlock::isRenderedInCurrentRequest()). A custom module can resolve this by marking the block as rendered via the SearchApiEvents::IS_RENDERED_IN_CURRENT_REQUEST event.

  • peri22 committed 4cbbed7a on 1.x
    Issue #2744769: Do not render an empty widget form when the sorts block...
peri22’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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