public function LanguageListBuilder::validateForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/src/LanguageListBuilder.php \Drupal\language\LanguageListBuilder::validateForm()
- 9 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\languageCode
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.'));
}
}