Problem/Motivation
When Acquia Connector and Acquia Search are installed at the same time, acquia_search_install() executes before Acquia Connector has been installed. As a result, the Acquia Connector-Acquia Search integration isn't properly deployed. Specifically, the following are not set:
API host: acquia_search.settings config value for api_host
API key: acquia_search.api_key state
Identifier: acquia_search.identifier state
UUID: acquia_search.uuid state
As a result, the following warning is displayed on the 'Edit search server Acquia Search API Solr server' page (/admin/config/search/search-api/server/acquia_search_server/edit):
Could not find a Solr core corresponding to your website and environment. Your subscription contains no cores. To fix this problem, please read [our documentation](https://docs.acquia.com/acquia-search/multiple-cores/).
Relevant code:
/**
* Implements hook_install().
*/
function acquia_search_install() {
// Import settings from the connector if it is installed and configured.
$connector = \Drupal::moduleHandler()->moduleExists('acquia_connector');
$subscription = \Drupal::state()->get('acquia_subscription_data');
$storage = new Storage();
if ($connector && isset($subscription)) { // <-- Acquia Connector isn't installed yet, so nothing herein is executed.
$storage->setApiHost(\Drupal::config('acquia_search.settings')->get('api_host') ?? 'https://api.sr-prod02.acquia.com');
$storage->setApiKey(\Drupal::state()->get('acquia_connector.key'));
$storage->setIdentifier(\Drupal::state()->get('acquia_connector.identifier'));
$storage->setUuid($subscription['uuid']);
}
}
Steps to reproduce
- Install Acquia Connector
- Install Acquia Search
- Observe Solr core is correctly registered by Acquia Search
- Install Acquia Connector and Acquia Search (same time)
- Observe Solr core is not registered by Acquia Search
Proposed resolution
TBD
Remaining tasks
TBD
User interface changes
TBD
API changes
None
Data model changes
None
Comments
Comment #2
japerryMarking outdated, as this has been fixed/rewritten in the 3.1.x branch and 3.0.x is going end of life.
Comment #3
mglamanFor those following, this can be remedied with Drush for an immediate fix. Replace items within
{}to proper product keys and application ID values.