VeggieMeat / search_api_elasticsearch

Clone of project at drupal.org/project/search_api_elasticsearch for better CI options than what D.O offers
16 stars 8 forks source link

Fatal error when Search API Spellcheck is not installed #65

Closed DavidACameron-USDA closed 9 years ago

DavidACameron-USDA commented 9 years ago

I've run into this error twice now, both on my development laptop and my test server.

Steps to reproduce:

  1. Install an Elasticsearch server.
  2. Install Drupal with search_api, search_api_elasticsearch, search_api_elasticsearch_elastica, the Elastica library, and any required dependencies. Do not install search_api_spellcheck.
  3. Set up a Search API server that connects to the new Elasticsearch server via Elastica.
  4. Set up a Search API index that uses the new server. I gave mine basic configuration like indexing node titles of a particular bundle, but nothing else.
  5. Visit the new index's View page.

Expected behavior: I should be able to view the index's details.

Actual behavior: WSOD caused by a PHP fatal error. The stack trace is pasted below. Drupal's class autoloader tries to find the SearchAPISpellcheck class for some reason. Since that module isn't installed, we get a WSOD.

I checked search_api_solr as another example of a Search API module, but it also has its SearchAPISpellcheck subclass being autoloaded. So I don't know why Drupal is trying to autoload the Elasticsearch module's class.

[Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP Fatal error: Class 'SearchApiSpellcheck' not found in /.../modules/search_api_elasticsearch/modules/elastica/includes/SearchApiElasticsearchElasticaSpellcheck.inc on line 3, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP Stack trace:, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 1. {main}() /index.php:0, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 2. menu_execute_active_handler() /index.php:21, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 3. call_user_func_array() /.../includes/menu.inc:517, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 4. search_api_admin_index_view() /.../includes/menu.inc:517, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 5. _search_api_get_items_on_server() /.../modules/search_api/search_api.admin.inc:864, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 6. SearchApiServer->search() /.../modules/search_api/search_api.module:2864, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 7. SearchApiElasticsearchElastica->search() /.../modules/search_api/includes/server_entity.inc:374, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 8. SearchApiElasticsearchElastica->parseSearchResponse() /.../modules/search_api_elasticsearch/modules/elastica/includes/SearchApiElasticsearchElastica.inc:352, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 9. drupal_autoload_class() /.../modules/search_api_elasticsearch/modules/elastica/includes/SearchApiElasticsearchElastica.inc:0, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 10. _registry_check_code() /.../includes/bootstrap.inc:3103, referer: http://mysite/admin/config/search/search_api [Sat Dec 06 23:48:22 2014] [error] [client 172.5.72.146] PHP 11. require_once() /.../includes/bootstrap.inc:3179, referer: http://mysite/admin/config/search/search_api