summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Rowlands2017-08-22 08:29:32 (GMT)
committerLee Rowlands2017-08-22 08:29:32 (GMT)
commit3bbf3142c24f8a5c998d5f65462624f3fa631663 (patch)
treea99bd505368c8c41a1a8ea5915c03aa76730b364
parenteb596f296140fd941cbb4b71d5fb7f24f957fc43 (diff)
Issue #2900911 by scott_euser, Sam152, Lendude: \Drupal\workflows\Form\WorkflowTransitionAddForm::form sets a default value for radios as an empty array
-rw-r--r--core/modules/workflows/src/Form/WorkflowTransitionAddForm.php1
-rw-r--r--core/modules/workflows/tests/src/Functional/WorkflowUiTest.php2
2 files changed, 2 insertions, 1 deletions
diff --git a/core/modules/workflows/src/Form/WorkflowTransitionAddForm.php b/core/modules/workflows/src/Form/WorkflowTransitionAddForm.php
index 3a58281..8452292 100644
--- a/core/modules/workflows/src/Form/WorkflowTransitionAddForm.php
+++ b/core/modules/workflows/src/Form/WorkflowTransitionAddForm.php
@@ -89,7 +89,6 @@ class WorkflowTransitionAddForm extends EntityForm {
'#type' => 'radios',
'#title' => $this->t('To'),
'#required' => TRUE,
- '#default_value' => [],
'#options' => $states,
];
diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
index b924f48..fcbcbd0 100644
--- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
+++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php
@@ -137,6 +137,8 @@ class WorkflowUiTest extends BrowserTestBase {
$this->assertTrue($workflow->getTypePlugin()->getState('draft')->canTransitionTo('published'), 'Can transition from draft to published');
$this->clickLink('Add a new transition');
+ $this->assertCount(2, $this->cssSelect('input[name="to"][type="radio"]'));
+ $this->assertCount(0, $this->cssSelect('input[name="to"][checked="checked"][type="radio"]'));
$this->submitForm(['id' => 'create_new_draft', 'label' => 'Create new draft', 'from[draft]' => 'draft', 'to' => 'draft'], 'Save');
$this->assertSession()->pageTextContains('Created Create new draft transition.');
$workflow = $workflow_storage->loadUnchanged('test');