From a115d7cc0303a69cbdf146780ab69e19b3cb4aa5 Mon Sep 17 00:00:00 2001
From: webchick <drupal@webchick.net>
Date: Mon, 4 Aug 2014 09:27:46 -0700
Subject: [PATCH] Issue #2310371 by dawehner: Replace
 Views::getApplicableViews('uses_hook_menu') with
 Views::getApplicableViews('uses_menu_links').

---
 .../src/Plugin/views/display/EntityReference.php              | 2 +-
 core/modules/views/src/Annotation/ViewsDisplay.php            | 2 +-
 core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php   | 2 +-
 core/modules/views/src/Plugin/Derivative/ViewsMenuLink.php    | 4 +---
 core/modules/views/src/Plugin/views/display/Embed.php         | 2 +-
 core/modules/views/src/Plugin/views/display/Page.php          | 2 +-
 core/modules/views/src/Views.php                              | 2 +-
 core/modules/views/views.module                               | 2 +-
 core/modules/views_ui/tests/src/ViewListBuilderTest.php       | 2 +-
 9 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php b/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php
index b75983162c45..beeb095a24b3 100644
--- a/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php
+++ b/core/modules/entity_reference/src/Plugin/views/display/EntityReference.php
@@ -25,7 +25,7 @@
  *   help = @Translation("Selects referenceable entities for an entity reference field."),
  *   theme = "views_view",
  *   register_theme = FALSE,
- *   uses_hook_menu = FALSE,
+ *   uses_menu_links = FALSE,
  *   entity_reference_display = TRUE
  * )
  */
diff --git a/core/modules/views/src/Annotation/ViewsDisplay.php b/core/modules/views/src/Annotation/ViewsDisplay.php
index 2efecd46e6a8..76f402dc8731 100644
--- a/core/modules/views/src/Annotation/ViewsDisplay.php
+++ b/core/modules/views/src/Annotation/ViewsDisplay.php
@@ -71,7 +71,7 @@ class ViewsDisplay extends ViewsPluginAnnotationBase {
    *
    * @var bool
    */
-  public $uses_hook_menu;
+  public $uses_menu_links;
 
   /**
    * Does the display plugin registers routes to the route.
diff --git a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
index f1ae20dda6bc..ef531b4e207a 100644
--- a/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
+++ b/core/modules/views/src/Plugin/Derivative/ViewsLocalTask.php
@@ -150,7 +150,7 @@ public function alterLocalTasks(&$local_tasks) {
    * @endcode
    */
   protected function getApplicableMenuViews() {
-    return Views::getApplicableViews('uses_hook_menu');
+    return Views::getApplicableViews('uses_menu_links');
   }
 
 }
diff --git a/core/modules/views/src/Plugin/Derivative/ViewsMenuLink.php b/core/modules/views/src/Plugin/Derivative/ViewsMenuLink.php
index e83af2be214e..e4e7bc0145da 100644
--- a/core/modules/views/src/Plugin/Derivative/ViewsMenuLink.php
+++ b/core/modules/views/src/Plugin/Derivative/ViewsMenuLink.php
@@ -34,9 +34,7 @@ public function getDerivativeDefinition($derivative_id, $base_plugin_definition)
    */
   public function getDerivativeDefinitions($base_plugin_definition) {
     $links = array();
-    // @todo Replace uses_hook_menu with an annotation.
-    //   https://www.drupal.org/node/2310371
-    $views = Views::getApplicableViews('uses_hook_menu');
+    $views = Views::getApplicableViews('uses_menu_links');
     foreach ($views as $data) {
       /** @var \Drupal\views\ViewExecutable $view */
       list($view, $display_id) = $data;
diff --git a/core/modules/views/src/Plugin/views/display/Embed.php b/core/modules/views/src/Plugin/views/display/Embed.php
index c1cd149ef539..816992181a1e 100644
--- a/core/modules/views/src/Plugin/views/display/Embed.php
+++ b/core/modules/views/src/Plugin/views/display/Embed.php
@@ -20,7 +20,7 @@
  *   title = @Translation("Embed"),
  *   help = @Translation("Provide a display which can be embedded using the views api."),
  *   theme = "views_view",
- *   uses_hook_menu = FALSE
+ *   uses_menu_links = FALSE
  * )
  */
 class Embed extends DisplayPluginBase {
diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php
index ca099a2f293c..0ad1c8719b1a 100644
--- a/core/modules/views/src/Plugin/views/display/Page.php
+++ b/core/modules/views/src/Plugin/views/display/Page.php
@@ -21,7 +21,7 @@
  *   id = "page",
  *   title = @Translation("Page"),
  *   help = @Translation("Display the view as a page, with a URL and menu links."),
- *   uses_hook_menu = TRUE,
+ *   uses_menu_links = TRUE,
  *   uses_route = TRUE,
  *   contextual_links_locations = {"page"},
  *   theme = "views_view",
diff --git a/core/modules/views/src/Views.php b/core/modules/views/src/Views.php
index 61f053c1a55c..525177fc12f3 100644
--- a/core/modules/views/src/Views.php
+++ b/core/modules/views/src/Views.php
@@ -198,7 +198,7 @@ public static function getEnabledDisplayExtenders() {
    * setting in their display's plugin settings.
    *
    * @param string $type
-   *   A flag from the display plugin definitions (e.g, 'uses_hook_menu').
+   *   A flag from the display plugin definitions (e.g, 'uses_menu_links').
    *
    * @return array
    *   A list of arrays containing the $view and $display_id.
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 28db666f4ed8..d1979df5afbf 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -661,7 +661,7 @@ function views_get_enabled_display_extenders() {
  * setting in their display's plugin settings.
  *
  * @param string $type
- *   A flag from the display plugin definitions (e.g, 'uses_hook_menu').
+ *   A flag from the display plugin definitions (e.g, 'uses_menu_links').
  *
  * @return array
  *   A list of arrays containing the $view and $display_id.
diff --git a/core/modules/views_ui/tests/src/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/ViewListBuilderTest.php
index 637fe9f2fcd4..14b5f330a189 100644
--- a/core/modules/views_ui/tests/src/ViewListBuilderTest.php
+++ b/core/modules/views_ui/tests/src/ViewListBuilderTest.php
@@ -56,7 +56,7 @@ public function testBuildRowEntityList() {
           array(
             'id' => 'page',
             'title' => 'Page',
-            'uses_hook_menu' => TRUE,
+            'uses_menu_links' => TRUE,
             'uses_route' => TRUE,
             'contextual_links_locations' => array('page'),
             'theme' => 'views_view',
-- 
GitLab