Currently search-api rather easily kills your site. It throws exceptions which are not caught, thus they break your site. In particular if they appear on update.php...

The recent item_type, entity_type update broke update.php if you had something exported in code. Even fixing the features doesn't suffice to make it working again. Attached patch helped, so one was able to run update.php.

The exception was triggered that way on update.php:
- rebuild theme cache
- rebuild views plugins
- rebuild views data
- get search api indexes
- get data source controller
- bang (as item_type is unset)

    Notice: Undefined index: name in search_api_views_views_data() (line 14 of ../profiles/recruiter/modules/search_api/contrib/search_api_views/search_api_views.views.inc).
    SearchApiException: Unknown or invalid item type . in search_api_get_datasource_controller() (line 1155 of ../profiles/recruiter/modules/search_api/search_api.module).

Then, also when disabling a feature module containing facts + an index in code (recruiter) the follow fatal error is thrown regardless of the item_type problem:

( ! ) Fatal error: Call to a member function entityWrapper() on a non-object in .../search_api/contrib/search_api_facets/search_api_facets.module on line 932
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey’s picture

Title: improve the error handling » Improve error handling

So, where else would you say we should catch the exceptions?

mikl’s picture

Status: Active » Reviewed & tested by the community

The patch looks like a fine way to avoid this.

drunken monkey’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
14.29 KB

God, nearly a year without progress …
Sorry, everyone!

But the attached patch should at least catch exceptions in the more obvious and annoying places …

drunken monkey’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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