function SettingsForm::validateForm

Same name in other branches
  1. 9 core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::validateForm()
  2. 8.9.x core/modules/aggregator/src/Form/SettingsForm.php \Drupal\aggregator\Form\SettingsForm::validateForm()
  3. 11.x core/modules/navigation/src/Form/SettingsForm.php \Drupal\navigation\Form\SettingsForm::validateForm()

Overrides ConfigFormBase::validateForm

File

core/modules/navigation/src/Form/SettingsForm.php, line 173

Class

SettingsForm
Configure Navigation settings for this site.

Namespace

Drupal\navigation\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) : void {
    $logo_managed = $form_state->getValue('logo_managed');
    if ($form_state->getValue('logo_provider') === NavigationRenderer::LOGO_PROVIDER_CUSTOM && empty($logo_managed) === TRUE) {
        $form_state->setErrorByName('logo_managed', 'An image file is required with the current logo handling option.');
    }
}

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