summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2017-02-27 22:54:44 (GMT)
committerAlex Pott2017-02-27 22:54:44 (GMT)
commit973e6b4f16faf3d0557663f896f96695d78870cf (patch)
tree79f9e3c29416059f51389a931d98cfd269270d09
parent57b145bf9cac4ae599802c0cd0bc68169c1edd37 (diff)
Issue #2855428 by Sam152, jhedstrom, timmillwood: Workflow state and transition add/edit form IDs have a '-' in them
-rw-r--r--core/lib/Drupal/Core/Entity/EntityForm.php2
-rw-r--r--core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php5
2 files changed, 6 insertions, 1 deletions
diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php
index b4f6bd6..80e1f8c 100644
--- a/core/lib/Drupal/Core/Entity/EntityForm.php
+++ b/core/lib/Drupal/Core/Entity/EntityForm.php
@@ -90,7 +90,7 @@ class EntityForm extends FormBase implements EntityFormInterface {
$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 15fd234..8aa31caf 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityFormTest.php
@@ -97,6 +97,11 @@ class EntityFormTest extends UnitTestCase {
'bundle' => '',
'operation' => 'delete',
)),
+ array('workflow_edit_state_form', array(
+ 'entity_type' => 'workflow',
+ 'bundle' => '',
+ 'operation' => 'edit-state',
+ )),
);
}