From c28b5ad8c0e5e8793a63e557b174b59a7d728511 Mon Sep 17 00:00:00 2001 From: Amaia Anabitarte Date: Tue, 15 Mar 2022 18:00:40 +0100 Subject: [PATCH] MDL-74199 core_user: Remove breadcrumbs on private files --- lib/navigationlib.php | 1 + theme/boost/tests/behat/breadcrumb.feature | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 807878163f6..108658f7224 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -3042,6 +3042,7 @@ class global_navigation extends navigation_node { self::TYPE_SETTING, null, 'privatefiles', new pix_icon('i/privatefiles', '')); $node->display = false; $node->showinflatnavigation = true; + $node->mainnavonly = true; } } diff --git a/theme/boost/tests/behat/breadcrumb.feature b/theme/boost/tests/behat/breadcrumb.feature index 2ec398e2db2..e9fabb3ba99 100644 --- a/theme/boost/tests/behat/breadcrumb.feature +++ b/theme/boost/tests/behat/breadcrumb.feature @@ -45,7 +45,7 @@ Feature: Breadcrumbs navigation And I should see "Cat 1" in the ".breadcrumb" "css_element" And I should see "Manage courses and categories" in the ".breadcrumb" "css_element" - Scenario: Admin user sets the default home page to 'Site' and navigates to its 'Preferences' page + Scenario: Admin user sets the default home page to 'Site' and navigates to its 'Preferences' and 'Private files' page Given the following config values are set as admin: | defaulthomepage | 0 | And I log in as "admin" @@ -53,26 +53,35 @@ Feature: Breadcrumbs navigation # There should be no breadcrumbs on this page. Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" - Scenario: Admin user sets the default home page to 'Dashboard' and navigates to its 'Preferences' page + Scenario: Admin user sets the default home page to 'Dashboard' and navigates to its 'Preferences' and 'Private files' page Given the following config values are set as admin: | defaulthomepage | 1 | And I log in as "admin" When I follow "Preferences" in the user menu # There should be no breadcrumbs on this page. Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" + And I follow "Private files" in the user menu + # There should be no breadcrumbs on this page. + And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" - Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' page + Scenario: Admin user sets the default home page to 'User preference' and navigates to its 'Preferences' and 'Private files' page Given the following config values are set as admin: | defaulthomepage | 2 | And I log in as "admin" When I follow "Preferences" in the user menu # There should be no breadcrumbs on this page. Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" + And I follow "Private files" in the user menu + # There should be no breadcrumbs on this page. + And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" - Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' page + Scenario: Admin user sets the default home page to 'My courses' and navigates to its 'Preferences' and 'Private files' page Given the following config values are set as admin: | defaulthomepage | 3 | And I log in as "admin" When I follow "Preferences" in the user menu # There should be no breadcrumbs on this page. Then ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element" + And I follow "Private files" in the user menu + # There should be no breadcrumbs on this page. + And ".breadcrumb-item" "css_element" should not exist in the ".breadcrumb" "css_element"