function 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.