From fd2b5d5c6304c229f9d0548b684ff3e4978983e1 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Wed, 11 Jul 2018 11:52:57 +0200 Subject: [PATCH] MDL-59599 navigation: Respect previous activity-level navigation The original patch was overwriting grading methods navigation. All credit goes to Andrew Nicols. --- lib/navigationlib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 3ec8ccc54f7..4a1f7d79b75 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2733,7 +2733,7 @@ class global_navigation extends navigation_node { $gradenode = $coursenode->add(get_string('grades'), $url, self::TYPE_SETTING, null, 'grades', new pix_icon('i/grades', '')); // If the page type matches the grade part, then make the nav drawer grade node (incl. all sub pages) active. - if (strpos($this->page->pagetype, 'grade-') === 0) { + if ($this->page->context->contextlevel < CONTEXT_MODULE && strpos($this->page->pagetype, 'grade-') === 0) { $gradenode->make_active(); } }