Skip to content
Snippets Groups Projects
Commit 0c698e22 authored by Markus Kalkbrenner's avatar Markus Kalkbrenner Committed by Markus Kalkbrenner
Browse files

Issue #3261700 by mkalkbrenner: Throw more meaningful exceptions if config-set...

Issue #3261700 by mkalkbrenner: Throw more meaningful exceptions if config-set could not be generated
parent 310b2002
No related branches found
No related tags found
No related merge requests found
......@@ -262,8 +262,11 @@ class SolrConfigSetController extends ControllerBase {
/** @var \Drupal\search_api_solr\SolrBackendInterface $backend */
$backend = $this->getBackend();
$connector = $backend->getSolrConnector();
$solr_branch = $real_solr_branch = $connector->getSolrBranch($this->assumedMinimumVersion);
$solr_major_version = $connector->getSolrMajorVersion($this->assumedMinimumVersion);
if (!$solr_major_version) {
throw new SearchApiSolrException('The config-set could not be created because the targeted Solr version is missing. In case of an auto-detection of the version the Solr server might not be running or is not reachable or the API is blocked (check the log files). As a workaround you can manually configure the targeted Solr version in the settings.');
}
$solr_branch = $real_solr_branch = $connector->getSolrBranch($this->assumedMinimumVersion);
$template_path = drupal_get_path('module', 'search_api_solr') . '/solr-conf-templates/';
$solr_configset_template_mapping = [
......@@ -277,6 +280,10 @@ class SolrConfigSetController extends ControllerBase {
$this->eventDispatcher()->dispatch($event);
$solr_configset_template_mapping = $event->getConfigSetTemplateMapping();
if (!isset($solr_configset_template_mapping[$solr_branch])) {
throw new SearchApiSolrException(sprintf('No config-set template found for Solr branch %s', $solr_branch));
}
$search_api_solr_conf_path = $solr_configset_template_mapping[$solr_branch];
$solrcore_properties_file = $search_api_solr_conf_path . '/solrcore.properties';
if (file_exists($solrcore_properties_file) && is_readable($solrcore_properties_file)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment