MDL-58762 core: Get full course objects on navigation
authorJuan Leyva <juanleyvadelgado@gmail.com>
Wed, 5 Jul 2017 12:18:08 +0000 (13:18 +0100)
committerDavid Monllao <davidm@moodle.com>
Thu, 7 Sep 2017 08:53:33 +0000 (10:53 +0200)
The course object passed as parameter to extend_navigation_user
callback contained only a few parameters, some parameters like
showgrades or showreports were missing.
The callback should receive a full course object.

lib/navigationlib.php

index 79981cc..afcd47e 100644 (file)
@@ -2401,7 +2401,7 @@ class global_navigation extends navigation_node {
                 $reports = core_component::get_plugin_list('gradereport');
                 arsort($reports); // User is last, we want to test it first.
 
-                $userscourses = enrol_get_users_courses($user->id);
+                $userscourses = enrol_get_users_courses($user->id, false, '*');
                 $userscoursesnode = $usernode->add(get_string('courses'));
 
                 $count = 0;