Merge branch '46518-28' of git://github.com/samhemelryk/moodle
authorDan Poltawski <dan@moodle.com>
Fri, 24 Oct 2014 14:16:55 +0000 (15:16 +0100)
committerDan Poltawski <dan@moodle.com>
Fri, 24 Oct 2014 14:16:55 +0000 (15:16 +0100)
lib/navigationlib.php

index aabbdc6..b82f553 100644 (file)
@@ -2886,10 +2886,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');