MDL-46518 navigation: site glossaries now expand properly
authorSam Hemelryk <sam@moodle.com>
Mon, 13 Oct 2014 00:21:03 +0000 (13:21 +1300)
committerSam Hemelryk <sam@moodle.com>
Sun, 19 Oct 2014 22:18:36 +0000 (11:18 +1300)
lib/navigationlib.php

index d21c5b1..767af89 100644 (file)
@@ -2879,10 +2879,11 @@ class global_navigation_for_ajax extends global_navigation {
                 require_course_login($course, true, $cm, false, true);
                 $this->page->set_context(context_module::instance($cm->id));
                 $coursenode = $this->load_course($course);
-                if ($course->id != $SITE->id) {
-                    $this->load_course_sections($course, $coursenode, null, $cm);
+                $this->load_course_sections($course, $coursenode, null, $cm);
+                $activitynode = $coursenode->find($cm->id, self::TYPE_ACTIVITY);
+                if ($activitynode) {
+                    $modulenode = $this->load_activity($cm, $course, $activitynode);
                 }
-                $modulenode = $this->load_activity($cm, $course, $coursenode->find($cm->id, self::TYPE_ACTIVITY));
                 break;
             default:
                 throw new Exception('Unknown type');