You are here

public function ContentSelectForm::validateForm in WordPress Migrate 8.3

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides FormBase::validateForm

File

wordpress_migrate_ui/src/Form/ContentSelectForm.php, line 87

Class

ContentSelectForm
Simple wizard step form.

Namespace

Drupal\wordpress_migrate_ui\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (!$form_state
    ->getValue('blog_post_type') && $form_state
    ->getValue('page_type')) {
    $form_state
      ->setErrorByName('', $this
      ->t('Please select at least one content type to import.'));
  }
}