public function SearchApiFederatedSolrField::configurationFormValidate in Search API Federated Solr 7
Same name and namespace in other branches
- 7.3 src/SearchApiFederatedSolrField.php \SearchApiFederatedSolrField::configurationFormValidate()
- 7.2 src/SearchApiFederatedSolrField.php \SearchApiFederatedSolrField::configurationFormValidate()
Implements SearchApiAlterCallbackInterface::configurationFormValidate().
Overrides SearchApiAbstractAlterCallback::configurationFormValidate
File
- src/
SearchApiFederatedSolrField.php, line 144
Class
Code
public function configurationFormValidate(array $form, array &$values, array &$form_state) {
parent::configurationFormValidate($form, $values, $form_state);
foreach ($values['fields'] as $key => $field) {
if (preg_match('/^[0-9]|[^a-z0-9_]/i', $field['machine_name'])) {
$name = "callbacks][federated_field][settings][fields][{$key}][machine_name";
form_set_error($name, 'Federated field machine names must consist of alphanumeric or underscore characters only and not start with a digit.');
}
}
}