You are here

public function MaestroTemplateBuilderEditTask::validateForm in Maestro 3.x

Same name and namespace in other branches
  1. 8.2 modules/maestro_template_builder/src/Form/MaestroTemplateBuilderEditTask.php \Drupal\maestro_template_builder\Form\MaestroTemplateBuilderEditTask::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/maestro_template_builder/src/Form/MaestroTemplateBuilderEditTask.php, line 29

Class

MaestroTemplateBuilderEditTask
Maestro Template Editor Edit a Task Form.

Namespace

Drupal\maestro_template_builder\Form

Code

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

  // TODO:  we should be passing validation off to the tasks as well.
  $templateMachineName = $form_state
    ->getValue('template_machine_name');
  $taskID = $form_state
    ->getValue('task_id');
  $template = MaestroEngine::getTemplate($templateMachineName);
  $task = MaestroEngine::getTemplateTaskByID($templateMachineName, $taskID);
  $executableTask = MaestroEngine::getPluginTask($task['tasktype']);
  $executableTask
    ->validateTaskEditForm($form, $form_state);
}