Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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?
Comment | File | Size | Author |
---|---|---|---|
#2 | 3063684-2--search_form_base_id.patch | 968 bytes | drunken monkey |
|
Comments
Comment #2
drunken monkeyI 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!
Comment #3
idebr CreditAttribution: idebr at ezCompany commentedThis patch is required to fix Search API Autocomplete integration tests #2986223: Switch JS tests to WebDriverTestBase
Comment #4
tars16 CreditAttribution: tars16 commentedI 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.
Comment #6
borisson_Committed and pushed, thanks @drunken monkey for reminding me about this.