diff --git a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php index b38c4a4..0a6d51f 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php +++ b/core/modules/views/lib/Drupal/views/Plugin/Derivative/ViewsLocalTask.php @@ -69,7 +69,8 @@ public function getDerivativeDefinitions($base_plugin_definition) { $executable->setDisplay($display_id); $menu = $executable->display_handler->getOption('menu'); - if (in_array($menu['type'], array('tab', 'default tab'))) { + foreach ($menu['type'] as $type) { + if (in_array($type, array('tab', 'default tab'))) { $plugin_id = 'view.' . $executable->storage->id() . '.' . $display_id; $route_name = $view_route_names[$executable->storage->id() . '.' . $display_id]; @@ -91,6 +92,7 @@ public function getDerivativeDefinitions($base_plugin_definition) { } } } + } return $this->derivatives; } @@ -108,7 +110,8 @@ public function alterLocalTasks(&$local_tasks) { $menu = $executable->display_handler->getOption('menu'); // We already have set the base_route for default tabs. - if (in_array($menu['type'], array('tab'))) { + foreach ($menu['type'] as $type) { + if (in_array($type, array('tab'))) { $plugin_id = 'view.' . $executable->storage->id() . '.' . $display_id; $view_route_name = $view_route_names[$executable->storage->id() . '.' . $display_id]; @@ -136,6 +139,7 @@ public function alterLocalTasks(&$local_tasks) { } } } + } /** * Return a list of all views and display IDs that have a menu entry. diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php index bc579a2..c2008a8 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php @@ -70,6 +70,15 @@ protected function defineOptions() { /** * {@inheritdoc} */ + protected function isDefaultTabPath() { + $menu = $this->getOption('menu'); + $tab_options = $this->getOption('tab_options'); + return in_array('default tab', $menu['type']) && !empty($tab_options['type']) && $tab_options['type'] != 'none'; + } + + /** + * {@inheritdoc} + */ protected function getRoute($view_id, $display_id) { $route = parent::getRoute($view_id, $display_id); diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php index 7e97db4..354c2b6 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php @@ -98,9 +98,7 @@ public function getPath() { * TRUE if the display path is for a default tab, FALSE otherwise. */ protected function isDefaultTabPath() { - $menu = $this->getOption('menu'); - $tab_options = $this->getOption('tab_options'); - return in_array('default tab', $menu['type']) && !empty($tab_options['type']) && $tab_options['type'] != 'none'; + return FALSE; } /** @@ -299,9 +297,9 @@ public function executeHookMenuLinkDefaults(array &$existing_links) { $path = implode('/', $bits); $menu_link_id = 'views.' . str_replace('/', '.', $path); - if ($path) { - $menu = $this->getOption('menu'); - if (!empty($menu['type']) && $menu['type'] == 'normal') { + if ($path && ($menu = $this->getOption('menu')) && !empty($menu['type'])) { + foreach ($menu['type'] as $type) { + if ($type == 'normal') { $links[$menu_link_id] = array(); // Some views might override existing paths, so we have to set the route // name based upon the altering. @@ -323,6 +321,7 @@ public function executeHookMenuLinkDefaults(array &$existing_links) { $links[$menu_link_id]['menu_name'] = $menu['name']; } } + } return $links; }