From 4e8898225b052cfb0d7a1e304d4e2e76df607598 Mon Sep 17 00:00:00 2001 From: Chris McCafferty <cilefen@gmail.com> Date: Sun, 26 Feb 2017 22:00:51 -0500 Subject: [PATCH] Issue #2850554 by scott_euser, Sam152, yoroy: Remain on the workflow edit page when saving --- core/modules/workflows/src/Form/WorkflowEditForm.php | 1 - .../workflows/tests/src/Functional/WorkflowUiTest.php | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/core/modules/workflows/src/Form/WorkflowEditForm.php b/core/modules/workflows/src/Form/WorkflowEditForm.php index 6b01920ada96..c0ea5a4d39e4 100644 --- a/core/modules/workflows/src/Form/WorkflowEditForm.php +++ b/core/modules/workflows/src/Form/WorkflowEditForm.php @@ -191,7 +191,6 @@ public function save(array $form, FormStateInterface $form_state) { $workflow = $this->entity; $workflow->save(); drupal_set_message($this->t('Saved the %label Workflow.', ['%label' => $workflow->label()])); - $form_state->setRedirectUrl($workflow->toUrl('collection')); } /** diff --git a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php index 91c69b73f7fe..3014dd739750 100644 --- a/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php +++ b/core/modules/workflows/tests/src/Functional/WorkflowUiTest.php @@ -176,9 +176,8 @@ public function testWorkflowCreation() { $workflow = $workflow_storage->loadUnchanged('test'); $this->assertEquals('draft', $workflow->getInitialState()->id()); - // This will take us to the list of workflows, so we need to edit the - // workflow again. - $this->clickLink('Edit'); + // Verify that we are still on the workflow edit page. + $this->assertSession()->addressEquals('admin/config/workflow/workflows/manage/test'); // Ensure that weight changes the transition ordering. $this->assertEquals(['publish', 'create_new_draft'], array_keys($workflow->getTransitions())); @@ -187,9 +186,8 @@ public function testWorkflowCreation() { $workflow = $workflow_storage->loadUnchanged('test'); $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 - // workflow again. - $this->clickLink('Edit'); + // Verify that we are still on the workflow edit page. + $this->assertSession()->addressEquals('admin/config/workflow/workflows/manage/test'); // Ensure that a delete link for the published state exists before deleting // the draft state. -- GitLab