.../modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php | 7 ++----- core/modules/views/src/Plugin/views/display/Page.php | 3 ++- .../test_views/views.view.test_page_display_menu.yml | 8 ++++---- core/modules/views_ui/src/Tests/DisplayPathTest.php | 1 + 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php index 7c859a1..2bb81be 100644 --- a/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php @@ -381,11 +381,8 @@ public function calculateDependencies() { $dependencies = parent::calculateDependencies(); $role_storage = \Drupal::entityManager()->getStorage('taxonomy_vocabulary'); - foreach (array_keys($this->options['vid']) as $vocabulary_id) { - if ($vocabulary = $role_storage->load($vocabulary_id)) { - $dependencies['config'][] = $vocabulary->getConfigDependencyName(); - } - } + $vocabulary = $role_storage->load($this->options['vid']); + $dependencies['config'][] = $vocabulary->getConfigDependencyName(); return $dependencies; } diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index b4fbd34..8837160 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -202,7 +202,8 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { // Only display the parent selector if Menu UI module is enabled. $menu_parent = $menu['menu_name'] . ':' . $menu['parent']; if (\Drupal::moduleHandler()->moduleExists('menu_ui')) { - $form['menu']['parent'] = \Drupal::service('menu.parent_form_selector')->parentSelectElement($menu_parent); + $menu_link = 'views_view:views.' . $form_state->get('view')->id() . '.' . $form_state->get('display_id'); + $form['menu']['parent'] = \Drupal::service('menu.parent_form_selector')->parentSelectElement($menu_parent, $menu_link); $form['menu']['parent'] += array( '#title' => $this->t('Parent'), '#description' => $this->t('The maximum depth for a link and all its children is fixed. Some menu links may not be available as parents if selecting them would exceed this limit.'), diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml index c9b40a5..7467d36 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_page_display_menu.yml @@ -97,7 +97,7 @@ display: title: 'Test page as child' menu: type: normal - title: 'Test child' + title: 'Test child (with parent)' parent: system.admin description: '' menu_name: tools @@ -117,10 +117,10 @@ display: title: 'Tests a menu with a non-existing parent' menu: type: normal - title: 'Test child' - parent: system.admin + title: 'Test child with non-existing parent' + parent: llamasarelame description: '' - menu_name: not-existing-menu-name + menu_name: tools weight: 0 context: '0' defaults: diff --git a/core/modules/views_ui/src/Tests/DisplayPathTest.php b/core/modules/views_ui/src/Tests/DisplayPathTest.php index 71b2035..144813b 100644 --- a/core/modules/views_ui/src/Tests/DisplayPathTest.php +++ b/core/modules/views_ui/src/Tests/DisplayPathTest.php @@ -145,6 +145,7 @@ public function testMenuOptions() { '
', '', '-- Compose tips (disabled)', + '-- Test child (with parent)', '-- Test menu link', ], $menu_options); }