You are here

public function LanguageListBuilder::validateForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::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 DraggableListBuilder::validateForm

File

core/modules/language/src/LanguageListBuilder.php, line 146

Class

LanguageListBuilder
Defines a class to build a listing of language entities.

Namespace

Drupal\language

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (!isset($this->entities[$form_state
    ->getValue('site_default_language')])) {
    $form_state
      ->setErrorByName('site_default_language', $this
      ->t('Selected default language no longer exists.'));
  }
}