function WorkflowDeleteForm::buildForm

Overrides EntityConfirmFormBase::buildForm

File

core/modules/workflows/src/Form/WorkflowDeleteForm.php, line 19

Class

WorkflowDeleteForm
Builds the form to delete Workflow entities.

Namespace

Drupal\workflows\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  if ($this->entity
    ->getTypePlugin()
    ->workflowHasData($this->entity)) {
    $form['#title'] = $this->getQuestion();
    $form['description'] = [
      '#markup' => $this->t('This workflow is in use. You cannot remove this workflow until you have removed all content using it.'),
    ];
    return $form;
  }
  return parent::buildForm($form, $form_state);
}

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