You are here

function simple_node_importer_validate in Simple Node Importer 8

1 string reference to 'simple_node_importer_validate'
simple_node_importer_form_alter in ./simple_node_importer.module
Implements hook_form_alter().

File

./simple_node_importer.module, line 385
Simple node importer module file.

Code

function simple_node_importer_validate(&$form, FormStateInterface &$form_state) {
  $entity_selected = $form_state
    ->getValue('field_select_entity_type')[0]['value'];
  if ($entity_selected == 'node') {
    $content_type_selected = $form_state
      ->getValue('field_select_content_type')[0]['value'];

    // $tempstore->set('content_type_selected', $content_type_selected);.
    if (empty($content_type_selected)) {
      $form_state
        ->setErrorByName('field_select_content_type', t('select content type is required feild'));
    }
  }
}