From adaf8355074ba3e142f61e10f1790382db5defb9 Mon Sep 17 00:00:00 2001
From: webchick <webchick@24967.no-reply.drupal.org>
Date: Wed, 25 Sep 2013 13:33:18 +0200
Subject: [PATCH] Issue #2097327 by Berdir: Fixed Unecessary cache clear/router
 rebuild in views_menu().

---
 .../views/lib/Drupal/views/Tests/Plugin/DisplayTest.php       | 4 ++--
 core/modules/views/views.module                               | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
index e38132c5b3d5..5fb2973d4a38 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/DisplayTest.php
@@ -242,8 +242,8 @@ public function testInvalidDisplayPlugins() {
     $this->assertResponse(200);
     $this->assertText(t('The plugin (invalid) did not specify an instance class.'));
 
-    // Rebuild the menu, and ensure that the path is not accessible anymore.
-    menu_router_rebuild();
+    // Rebuild the router, and ensure that the path is not accessible anymore.
+    views_invalidate_cache();
 
     $this->drupalGet('test_display_invalid');
     $this->assertResponse(404);
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index d8e0712361e3..c238f4f77c56 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -312,9 +312,6 @@ function views_permission() {
  * Implement hook_menu().
  */
 function views_menu() {
-  // Any event which causes a menu rebuild could potentially mean that the
-  // Views data is updated -- module changes, profile changes, etc.
-  views_invalidate_cache();
   $items = array();
   $items['views/ajax'] = array(
     'title' => 'Views',
-- 
GitLab