I was making a PoC of a search we we're doing, on a clean install I tried getting autocomplete to work. After some debugging I've found the form_id that is used to attach the autocomplete on search pages is no longer valid.

If I'm correct this issue(https://www.drupal.org/node/2856955) lies at the core of the problem, the original search_api_page_block_form id now has a suffix, which makes it so that this hook is never called: search_api_autocomplete_form_search_api_page_block_form_alter

I was wondering if this issue belongs here or in the search_api_page issue queue?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RicardoPeters created an issue. See original summary.

drunken monkey’s picture

Title: search_api_page_block_form no longer valid in search_api_page:^1.0-beta1 » Search block form should define a base form ID
Project: Search API Autocomplete » Search API Pages
Component: General code » Code
Status: Active » Needs review
FileSize
968 bytes

I think it would be best to resolve this in the Pages module. I think when defining similar forms with the same class it is best practice to assign a base form ID to those forms. If we assign the previous form ID as the new base form ID, all code using alter hooks on that form will continue to work as before.
Patch attached, please review!

idebr’s picture

Status: Needs review » Reviewed & tested by the community

This patch is required to fix Search API Autocomplete integration tests #2986223: Switch JS tests to WebDriverTestBase

tars16’s picture

I have the same issue, what version of search_api, search_api_page and search_api_autocomplete are you running? I've tried with the latest dev branch of each as well as the latest release branch of each and I'm unable to get this to work.

borisson_’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed, thanks @drunken monkey for reminding me about this.

Status: Fixed » Closed (fixed)

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