After I updated to Search_API 1.21 I get the following error if make a View with type Multi-index search.

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/view/full_mis/preview/default/ajax
StatusText: Service unavailable (with message)
ResponseText: Recoverable fatal error: Object of class SearchApiMultiQuery could not be converted to string in SearchApiViewsQuery->build() (line 315 of /var/www/web/drupal7/sites/all/modules/search_api/contrib/search_api_views/includes/query.inc).

Views is on 3.15.
Not sure what went wrong here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

grossmann created an issue. See original summary.

Kingdutch’s picture

Encountered the same issue after upgrading to Search API 1.21

bmunslow’s picture

Same issue here.

The problem lies in the definition of the SearchApiMultiQuery class, which doesn't implement the __toString method.

Please find attached patch that fixes the issue.

It follows the guidelines of SearchApiQuery to implement the __toString method, simply adding the name of every index at the begginning ot the output.

bmunslow’s picture

Status: Active » Needs review
grossmann’s picture

Hi, i tested the patch and it works for me. But I didn't review the code that much. Can you show me where you found this:

It follows the guidelines of SearchApiQuery to implement the __toString method, ...

so I can take a closer look on the code.

bmunslow’s picture

@grossman:
Sure, take a look at the search_api module, file includes/query.inc line 841

grossmann’s picture

Status: Needs review » Reviewed & tested by the community

@bmunslow: Thanks for the info. I now looked into it and it seems pretty ok to me. So I set this to be RTBC.

zuernBernhard’s picture

Works here too, please commit.

drunken monkey’s picture

Status: Reviewed & tested by the community » Closed (outdated)

Has been fixed for half a year, please use the module's dev version.
(In general, please first try that before reporting an issue!)

grossmann’s picture

Unbelievable how stupid we are *smack head*. Of course we should have tried this first.
@drunken monkey: Thanks for clearing that up. Hopefully I remember this comment on my next problem ;-)