Unverified Commit 3bbf3142 authored by larowlan's avatar larowlan

Issue #2900911 by scott_euser, Sam152, Lendude:...

Issue #2900911 by scott_euser, Sam152, Lendude: \Drupal\workflows\Form\WorkflowTransitionAddForm::form sets a default value for radios as an empty array
parent eb596f29
......@@ -89,7 +89,6 @@ public function form(array $form, FormStateInterface $form_state) {
'#type' => 'radios',
'#title' => $this->t('To'),
'#required' => TRUE,
'#default_value' => [],
'#options' => $states,
];
......
......@@ -137,6 +137,8 @@ public function testWorkflowCreation() {
$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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment