From f2863769132d3d22ffc03fb03b544252d3a0786f Mon Sep 17 00:00:00 2001
From: Adrian Perez
Date: Sat, 16 Feb 2019 21:58:04 +0100
Subject: [PATCH] MDL-62345 navigation: Change data-key for dashboard rootnode
---
lib/navigationlib.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/navigationlib.php b/lib/navigationlib.php
index 1090652fc70..a32d3ea3222 100644
--- a/lib/navigationlib.php
+++ b/lib/navigationlib.php
@@ -1280,7 +1280,7 @@ class global_navigation extends navigation_node {
// The home element should be my moodle because the root element is the site
if (isloggedin() && !isguestuser()) { // Makes no sense if you aren't logged in
$this->rootnodes['home'] = $this->add(get_string('myhome'), new moodle_url('/my/'),
- self::TYPE_SETTING, null, 'home', new pix_icon('i/dashboard', ''));
+ self::TYPE_SETTING, null, 'myhome', new pix_icon('i/dashboard', ''));
$this->rootnodes['home']->showinflatnavigation = true;
}
} else {
@@ -1488,7 +1488,7 @@ class global_navigation extends navigation_node {
foreach ($this->rootnodes as $node) {
// Dont remove the home node
/** @var navigation_node $node */
- if ($node->key !== 'home' && !$node->has_children() && !$node->isactive) {
+ if (!in_array($node->key, ['home', 'myhome']) && !$node->has_children() && !$node->isactive) {
$node->remove();
}
}