From 881f388ce15da02856be8daaee7e3cbe6fae3da1 Mon Sep 17 00:00:00 2001
From: git <git@3355222.no-reply.drupal.org>
Date: Tue, 26 Apr 2016 18:21:07 +0200
Subject: [PATCH] Issue #2709489 by CTaPByK, slashrsm: RevisionsOverviewDeriver
 uses wrong base_route

---
 src/Plugin/Derivative/RevisionsOverviewDeriver.php     |  2 +-
 .../entity_module_test.links.task.yml                  | 10 +++++-----
 tests/src/Functional/RevisionRouteAccessTest.php       |  3 +++
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/Plugin/Derivative/RevisionsOverviewDeriver.php b/src/Plugin/Derivative/RevisionsOverviewDeriver.php
index b7e308b..e6d4d68 100644
--- a/src/Plugin/Derivative/RevisionsOverviewDeriver.php
+++ b/src/Plugin/Derivative/RevisionsOverviewDeriver.php
@@ -61,7 +61,7 @@ class RevisionsOverviewDeriver extends DeriverBase implements ContainerDeriverIn
       $this->derivatives[$entity_type_id] = [
         'route_name' => "entity.$entity_type_id.version_history",
         'title' => 'Revisions',
-        'base_route' => "entity.$entity_type_id.edit_form",
+        'base_route' => "entity.$entity_type_id.canonical",
         'weight' => 20,
       ] + $base_plugin_definition;
     }
diff --git a/tests/modules/entity_module_test/entity_module_test.links.task.yml b/tests/modules/entity_module_test/entity_module_test.links.task.yml
index f680bb6..e306c10 100644
--- a/tests/modules/entity_module_test/entity_module_test.links.task.yml
+++ b/tests/modules/entity_module_test/entity_module_test.links.task.yml
@@ -1,9 +1,9 @@
-entity.entity_module_test.canonical:
+entity.entity_test_enhanced.canonical:
   title: View
-  route_name: entity.entity_module_test.canonical
-  base_route: entity.entity_module_test.canonical
+  route_name: entity.entity_test_enhanced.canonical
+  base_route: entity.entity_test_enhanced.canonical
 
 entity.entity_module_test.edit_form:
   title: Edit
-  route_name: entity.entity_module_test.edit_form
-  base_route: entity.entity_module_test.canonical
+  route_name: entity.entity_test_enhanced.edit_form
+  base_route: entity.entity_test_enhanced.canonical
diff --git a/tests/src/Functional/RevisionRouteAccessTest.php b/tests/src/Functional/RevisionRouteAccessTest.php
index 42c5840..8eddca4 100644
--- a/tests/src/Functional/RevisionRouteAccessTest.php
+++ b/tests/src/Functional/RevisionRouteAccessTest.php
@@ -82,6 +82,9 @@ class RevisionRouteAccessTest extends BrowserTestBase {
     $edit_link = $this->getSession()->getPage()->findLink('Edit');
     $edit_link->click();
     $this->assertSession()->addressEquals('/entity_test_enhanced/1/edit');
+    // Check if we have revision tab link on edit page.
+    $this->getSession()->getPage()->findLink('Revisions')->click();
+    $this->assertSession()->addressEquals('/entity_test_enhanced/1/revisions');
     $this->drupalGet('/entity_test_enhanced/1/revisions/2/view');
     $this->assertSession()->statusCodeEquals(200);
     $this->assertSession()->responseContains('rev 2');
-- 
GitLab