From 30b75b7190e533a4540b7b3e8cc75945d744fc51 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Fri, 18 Mar 2022 07:44:41 +0100 Subject: [PATCH] MDL-73233 navigation: Breadcrumbs removed from user preferences In MDL-74087 breadcrumbs were removed from the User preferences page. This patch re-introduces a piece of code that was removed originally in MDL-73233 while reviewing all the places where the Dashboard was displayed by default (to avoid inconsistencies). New item in primary navigation has been changed to "Home" but we still need the code re-added to hide breadcrumbs when its content matches the primary navigation. --- lib/navigationlib.php | 4 ++++ user/tests/behat/set_default_homepage.feature | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index d8de09d3f5f..4048714d5ab 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -5029,6 +5029,10 @@ class settings_navigation extends navigation_node { // This should be set to false as we don't want to show this to the user. It's only for generating the correct // breadcrumb. $mainpage->display = false; + $homepage = get_home_page(); + if (($homepage == HOMEPAGE_MY || $homepage == HOMEPAGE_MYCOURSES)) { + $mainpage->mainnavonly = true; + } $iscurrentuser = ($user->id == $USER->id); diff --git a/user/tests/behat/set_default_homepage.feature b/user/tests/behat/set_default_homepage.feature index f07aa1fbac2..53c2ab4a757 100644 --- a/user/tests/behat/set_default_homepage.feature +++ b/user/tests/behat/set_default_homepage.feature @@ -62,7 +62,6 @@ Feature: Set the site home page and dashboard as the default home page And I log out When I log in as "user1" And I follow "Preferences" in the user menu - And I should see "Home" in the ".breadcrumb" "css_element" And I follow "Start page" And I set the field "Start page" to "" And I press "Save changes"