You are here

public function AssignmentConfigureForm::validateForm in Features 8.3

Same name and namespace in other branches
  1. 8.4 modules/features_ui/src/Form/AssignmentConfigureForm.php \Drupal\features_ui\Form\AssignmentConfigureForm::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 FormBase::validateForm

File

modules/features_ui/src/Form/AssignmentConfigureForm.php, line 391

Class

AssignmentConfigureForm
Configures the configuration assignment methods for this site.

Namespace

Drupal\features_ui\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue([
    'bundle',
    'is_profile',
  ]) && empty($form_state
    ->getValue([
    'bundle',
    'profile_name',
  ]))) {
    $form_state
      ->setErrorByName('bundle][profile_name', $this
      ->t('To create a profile, please enter a profile name.'));
  }
}