mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-40174 navigation: don't remove active root nodes without children
This commit is contained in:
parent
ffc3f5308b
commit
75eb202ebd
1 changed files with 2 additions and 1 deletions
|
@ -1266,7 +1266,8 @@ class global_navigation extends navigation_node {
|
||||||
// Remove any empty root nodes
|
// Remove any empty root nodes
|
||||||
foreach ($this->rootnodes as $node) {
|
foreach ($this->rootnodes as $node) {
|
||||||
// Dont remove the home node
|
// Dont remove the home node
|
||||||
if ($node->key !== 'home' && !$node->has_children()) {
|
/** @var navigation_node $node */
|
||||||
|
if ($node->key !== 'home' && !$node->has_children() && !$node->isactive) {
|
||||||
$node->remove();
|
$node->remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue