The full error:

Recoverable fatal error: Argument 1 passed to search_api_autocomplete_access() must be an instance of SearchApiAutocompleteSearch, boolean given, called in mysite.local/html/sites/all/modules/search_api_autocomplete/search_api_autocomplete.search_api_views.inc on line 21 and defined in search_api_autocomplete_access() (line 153 of mysite.local/html/sites/all/modules/search_api_autocomplete/search_api_autocomplete.module).

I met this error after i update the module, and I added a simple argument check before invoking the SearchApiAutocompleteSearch().

Comments

derhasi’s picture

Status: Active » Reviewed & tested by the community

Had the same error. This patch fixed that and should be a easy one to commit (maybe without the empty line).

andypost’s picture

+1 to rtbc and please commit this

mh86’s picture

yep, same here. This was introduced by #1803010: Introduce per-search permissions.
And following code

if (!$search || !search_api_autocomplete_access($search)) {
  return;
}

should be enough. There is no need to explicitly check the type of the $search object, as search_api_autocomplete_search_load() returns FALSE if not autocomplete search is found.

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reporting and posting a patch!
I now committed a slightly different version – in fact, exactly the one from #3.
Sorry it took me so long to get back to you!

Status: Fixed » Closed (fixed)

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