You are here

public function ConditionForm::validateForm in Rules 8.3

Form validation callback to validate expression elements.

Parameters

array $form: The form array.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Overrides ExpressionFormInterface::validateForm

File

src/Form/Expression/ConditionForm.php, line 155

Class

ConditionForm
UI form for adding/editing a Rules condition.

Namespace

Drupal\rules\Form\Expression

Code

public function validateForm(array $form, FormStateInterface $form_state) {

  // Only if there is a condition selected already we can validate something.
  if ($form_state
    ->get('condition_id')) {

    // Invoke the submission handler which will setup the expression being
    // edited in the form. That way the expression is ready for other
    // validation handlers.
    $this
      ->submitForm($form, $form_state);
  }
}