public function SearchApiSolrBackend::validateConfigurationForm in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::validateConfigurationForm()
- 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::validateConfigurationForm()
- 8.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::validateConfigurationForm()
Throws
\Drupal\Component\Plugin\Exception\PluginException
\Drupal\search_api\SearchApiException
Overrides PluginFormInterface::validateConfigurationForm
File
- src/
Plugin/ search_api/ backend/ SearchApiSolrBackend.php, line 516
Class
- SearchApiSolrBackend
- Apache Solr backend for search api.
Namespace
Drupal\search_api_solr\Plugin\search_api\backendCode
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
// Check if the Solr connector plugin changed.
if ($form_state
->getValue('connector') != $form_state
->get('connector')) {
$new_connector = $this->solrConnectorPluginManager
->createInstance($form_state
->getValue('connector'));
if ($new_connector instanceof PluginFormInterface) {
$form_state
->setRebuild();
}
else {
$form_state
->setError($form['connector'], $this
->t('The connector could not be activated.'));
}
}
else {
$this->configuration['connector'] = $form_state
->get('connector');
$connector = $this
->getSolrConnector();
if ($connector instanceof PluginFormInterface) {
$connector_form_state = SubformState::createForSubform($form['connector_config'], $form, $form_state);
$connector
->validateConfigurationForm($form['connector_config'], $connector_form_state);
}
else {
$form_state
->setError($form['connector'], $this
->t('The connector could not be activated.'));
}
}
// @todo If any Solr Document datasource is selected, retrieve_data must be set.
// @todo If solr_document is the only datasource, skip_schema_check must be set.
}