From e49e554766540238c0b9370d7c9ee73416b7c7d3 Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 5 Dec 2019 11:02:58 +0000 Subject: [PATCH] Issue #2945243 by Lendude, msankhala, Nick Hope, dww: Remain on a View page after saving it --- core/modules/views_ui/src/ViewListBuilder.php | 2 ++ .../views_ui/tests/src/Functional/ViewsListTest.php | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/core/modules/views_ui/src/ViewListBuilder.php b/core/modules/views_ui/src/ViewListBuilder.php index 0a5ef2439bc..1595cf945bc 100644 --- a/core/modules/views_ui/src/ViewListBuilder.php +++ b/core/modules/views_ui/src/ViewListBuilder.php @@ -161,6 +161,8 @@ class ViewListBuilder extends ConfigEntityListBuilder { */ public function getDefaultOperations(EntityInterface $entity) { $operations = parent::getDefaultOperations($entity); + // Remove destination redirect for Edit operation. + $operations['edit']['url'] = $entity->toUrl('edit-form'); if ($entity->hasLinkTemplate('duplicate-form')) { $operations['duplicate'] = [ diff --git a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php index 80ac1b8d003..5557e12d7c8 100644 --- a/core/modules/views_ui/tests/src/Functional/ViewsListTest.php +++ b/core/modules/views_ui/tests/src/Functional/ViewsListTest.php @@ -52,6 +52,13 @@ class ViewsListTest extends UITestBase { $this->assertResponse(200); $this->assertLink(t('Add view')); + // Check that there is a link to the content view without a destination + // parameter. + $this->drupalGet('admin/structure/views'); + $links = $this->getSession()->getPage()->findAll('xpath', "//a[contains(@href, 'admin/structure/views/view/content')]"); + $this->assertStringEndsWith('admin/structure/views/view/content', $links[0]->getAttribute('href')); + $this->assertLinkByHref('admin/structure/views/view/content/delete?destination'); + // Count default views to be subtracted from the limit. $views = count(Views::getEnabledViews());