function LanguageListBuilder::validateForm

Same name in other branches
  1. 9 core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::validateForm()
  2. 8.9.x core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::validateForm()
  3. 10 core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::validateForm()

Overrides DraggableListBuilderTrait::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.'));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.