Commit 4e889822 authored by cilefen's avatar cilefen

Issue #2850554 by scott_euser, Sam152, yoroy: Remain on the workflow edit page when saving

parent 21f8a650
...@@ -191,7 +191,6 @@ public function save(array $form, FormStateInterface $form_state) { ...@@ -191,7 +191,6 @@ public function save(array $form, FormStateInterface $form_state) {
$workflow = $this->entity; $workflow = $this->entity;
$workflow->save(); $workflow->save();
drupal_set_message($this->t('Saved the %label Workflow.', ['%label' => $workflow->label()])); drupal_set_message($this->t('Saved the %label Workflow.', ['%label' => $workflow->label()]));
$form_state->setRedirectUrl($workflow->toUrl('collection'));
} }
/** /**
......
...@@ -176,9 +176,8 @@ public function testWorkflowCreation() { ...@@ -176,9 +176,8 @@ public function testWorkflowCreation() {
$workflow = $workflow_storage->loadUnchanged('test'); $workflow = $workflow_storage->loadUnchanged('test');
$this->assertEquals('draft', $workflow->getInitialState()->id()); $this->assertEquals('draft', $workflow->getInitialState()->id());
// This will take us to the list of workflows, so we need to edit the // Verify that we are still on the workflow edit page.
// workflow again. $this->assertSession()->addressEquals('admin/config/workflow/workflows/manage/test');
$this->clickLink('Edit');
// Ensure that weight changes the transition ordering. // Ensure that weight changes the transition ordering.
$this->assertEquals(['publish', 'create_new_draft'], array_keys($workflow->getTransitions())); $this->assertEquals(['publish', 'create_new_draft'], array_keys($workflow->getTransitions()));
...@@ -187,9 +186,8 @@ public function testWorkflowCreation() { ...@@ -187,9 +186,8 @@ public function testWorkflowCreation() {
$workflow = $workflow_storage->loadUnchanged('test'); $workflow = $workflow_storage->loadUnchanged('test');
$this->assertEquals(['create_new_draft', 'publish'], array_keys($workflow->getTransitions())); $this->assertEquals(['create_new_draft', 'publish'], array_keys($workflow->getTransitions()));
// This will take us to the list of workflows, so we need to edit the // Verify that we are still on the workflow edit page.
// workflow again. $this->assertSession()->addressEquals('admin/config/workflow/workflows/manage/test');
$this->clickLink('Edit');
// Ensure that a delete link for the published state exists before deleting // Ensure that a delete link for the published state exists before deleting
// the draft state. // the draft state.
......
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