MDL-30582 navigation: Fixed regression in generation of front page modules
authorSam Hemelryk <sam@moodle.com>
Tue, 6 Dec 2011 00:32:59 +0000 (13:32 +1300)
committerSam Hemelryk <sam@moodle.com>
Tue, 6 Dec 2011 00:32:59 +0000 (13:32 +1300)
lib/navigationlib.php

index 6d67cce..8645e27 100644 (file)
@@ -1240,6 +1240,16 @@ class global_navigation extends navigation_node {
                     $sections = $this->load_course_sections($course, $coursenode);
                     break;
             }
+        } else {
+            // We need to check if the user is viewing a front page module.
+            // If so then there is potentially more content to load yet for that
+            // module.
+            if ($this->page->context->contextlevel == CONTEXT_MODULE) {
+                $activitynode = $this->rootnodes['site']->get($this->page->cm->id, navigation_node::TYPE_ACTIVITY);
+                if ($activitynode) {
+                    $this->load_activity($this->page->cm, $this->page->course, $activitynode);
+                }
+            }
         }
 
         $limit = 20;