You are here

function search_api_algolia_index_edit_form_validate in Search API Algolia 3.0.x

Form validation handler.

1 string reference to 'search_api_algolia_index_edit_form_validate'
search_api_algolia_form_search_api_index_edit_form_alter in ./search_api_algolia.module
Implements hook_form_FORM_ID_alter().

File

./search_api_algolia.module, line 86
Provides an Algolia Search based service class for the Search API.

Code

function search_api_algolia_index_edit_form_validate($form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('options')['algolia_index_batch_deletion'] && !empty($form_state
    ->getValue('options')['object_id_field'])) {
    $form_state
      ->setErrorByName('options][object_id_field', t('To use Custom Object ID, it is required to delete the items in batches.'));
  }
}