You are here

public function TranslationStatusForm::validateForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Form/TranslationStatusForm.php \Drupal\locale\Form\TranslationStatusForm::validateForm()

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

core/modules/locale/src/Form/TranslationStatusForm.php, line 260
Contains \Drupal\locale\Form\TranslationStatusForm.

Class

TranslationStatusForm
Provides a translation status form.

Namespace

Drupal\locale\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {

  // Check if a language has been selected. 'tableselect' doesn't.
  if (!array_filter($form_state
    ->getValue('langcodes'))) {
    $form_state
      ->setErrorByName('', $this
      ->t('Select a language to update.'));
  }
}