From 973e6b4f16faf3d0557663f896f96695d78870cf Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Mon, 27 Feb 2017 22:54:44 +0000
Subject: [PATCH] Issue #2855428 by Sam152, jhedstrom, timmillwood: Workflow
 state and transition add/edit form IDs have a '-' in them

---
 core/lib/Drupal/Core/Entity/EntityForm.php             | 2 +-
 core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index b4f6bd6f022c..80e1f8cfe5a8 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -90,7 +90,7 @@ public function getFormId() {
       $form_id .= '_' . $this->entity->bundle();
     }
     if ($this->operation != 'default') {
-      $form_id = $form_id . '_' . $this->operation;
+      $form_id = $form_id . '_' . str_replace('-', '_', $this->operation);
     }
     return $form_id . '_form';
   }
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
index 15fd23459204..8aa31cafaf2b 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
@@ -97,6 +97,11 @@ public function providerTestFormIds() {
         'bundle' => '',
         'operation' => 'delete',
       )),
+      array('workflow_edit_state_form', array(
+        'entity_type' => 'workflow',
+        'bundle' => '',
+        'operation' => 'edit-state',
+      )),
     );
   }
 
-- 
GitLab