When using the module on views integration it throws a notice:
Notice: Undefined offset: 0 in search_api_autocomplete_form_search_api_page_block_form_alter() (line 155 of modules/contrib/search_api_autocomplete/search_api_autocomplete.module)...
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 2912596-4--defensive_coding_page_form_alter.patch | 933 bytes | drunken monkey |
Comments
Comment #2
ceaucari commentedthis patch fixes it:
Comment #3
ceaucari commentedComment #4
drunken monkey\Drupal\search_api_page\Form\SearchApiPageBlockForm::buildForm()) also expects the argument and doesn't check for its existence.ifblock. See the attached patch.Comment #5
ceaucari commentedThank you Thomas for your comments, on the patch I indeed modified a hook related to Search API Pages, but I'm not using Search API Pages on the site, the results are being displayed using a view showing results from a Solr Index so that's probably why the argument is not being set, if Search API Pages is not being used search_api_autocomplete_form_search_api_page_block_form_alter() shouldn't be getting in the way.
I also disabled all our custom code to make sure is not a bug introduced by us, but the notice keeps showing up.
I can also confirm that your patch on #4 also fixes the problem.
Comment #6
drunken monkeyThat's weird, then. Could you get a backtrace for the error? It would really be interesting to know how that hook gets invoked.
Comment #7
drunken monkeyOK, as said, defensive coding can't hurt anyways. Getting more information would have been great, but the patch can go in anyways.
So, committed. Thanks again!