From 8507384ccc7e015bb902593a0bffc9974fae7a85 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 13 Mar 2024 20:48:28 +0000 Subject: [PATCH] MDL-78457 course: remove participants navigation if cannot access. --- lib/navigationlib.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 09cfc188f1e..1f49db3f0f9 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2968,6 +2968,9 @@ class global_navigation extends navigation_node { } } else if (count($this->extendforuser) > 0) { $coursenode->add(get_string('participants'), null, self::TYPE_CONTAINER, get_string('participants'), 'participants'); + } else if ($siteparticipantsnode = $this->rootnodes['site']->get('participants', self::TYPE_CUSTOM)) { + // The participants node was added for the site, but cannot be viewed inside the course itself, so remove. + $siteparticipantsnode->remove(); } // Badges.