summaryrefslogtreecommitdiffstats
path: root/core/modules/workflows/src/Form/WorkflowDeleteForm.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/workflows/src/Form/WorkflowDeleteForm.php')
-rw-r--r--core/modules/workflows/src/Form/WorkflowDeleteForm.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/modules/workflows/src/Form/WorkflowDeleteForm.php b/core/modules/workflows/src/Form/WorkflowDeleteForm.php
index b9b8331..e122f40 100644
--- a/core/modules/workflows/src/Form/WorkflowDeleteForm.php
+++ b/core/modules/workflows/src/Form/WorkflowDeleteForm.php
@@ -14,6 +14,19 @@ class WorkflowDeleteForm extends EntityConfirmFormBase {
/**
* {@inheritdoc}
*/
+ 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);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function getQuestion() {
return $this->t('Are you sure you want to delete %name?', ['%name' => $this->entity->label()]);
}