Problem/Motivation
When we pull the database from prod to dev on Acquia Cloud, the connector has a hard time re-resolving the solr server for that environment for the apachesolr module. When we try to visit the server settings page (/admin/config/search/apachesolr/settings), we get this error:
TypeError: Drupal\acquia_search\ApacheSolrEnvironment::getAcquiaServiceVersion(): Argument #1 ($service_class) must be of type string, null given, called in /var/www/html/docroot/sites/all/modules/acquia_connector/acquia_search/includes/acquia_search.apachesolr.inc on line 71 in Drupal\acquia_search\ApacheSolrEnvironment::getAcquiaServiceVersion() (line 125 of /var/www/html/docroot/sites/all/modules/acquia_connector/acquia_search/src/AcquiaSearchServiceTrait.php).
When I add a conditional to the code, that causes the error to stop and allows me to look at the settings, but I'm not really sure that's the right thing to do in this case.
foreach ($environments as $environment) {
if ($environment['service_class']) {
if ($version = ApacheSolrEnvironment::getAcquiaServiceVersion($environment['service_class'])) {
$count[$version]++;
unset($version);
}
}
}Issue fork acquia_connector-3328402
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
loopy1492 commentedAfter a few minutes, a new index with the correct server did appear in the list and I was able to set it as default. It didn't happen automatically, though.
Comment #6
japerry