Skip to content

Commit d446941

Browse files
committed
Issue #2374609 by Andreas Radloff: Facets cant be edited, page not found - The issue was connected with the composer manager that does not include the autoloading of the class.
1 parent c42be4b commit d446941

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/elasticsearch_connector_search_api/elasticsearch_connector_search_api.module

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ function elasticsearch_connector_search_api_search_api_service_info() {
2727
);
2828

2929
// If the ElasticSearch library isn't available, use a dummy service class.
30-
if (!class_exists('\Elasticsearch\Client')) {
31-
$services['search_api_elasticsearch_connector']['class'] = 'SearchApiElasticsearchConnectorMissing';
30+
if (!class_exists('\Elasticsearch\Client') && module_exists('composer_manager')) {
31+
// When using search_api_autocomplete the composer manager doesn't handle the class loading.
32+
// This can be an issue with composer manager and should be checked.
33+
composer_manager_register_autoloader();
34+
35+
if (!class_exists('\Elasticsearch\Client')) {
36+
$services['search_api_elasticsearch_connector']['class'] = 'SearchApiElasticsearchConnectorMissing';
37+
}
3238
}
3339

3440
return $services;

0 commit comments

Comments
 (0)