-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
1.8.2
-
None
-
None
-
Mac OS X 10.4.10 (PPC), Safari 3.0.2 (beta)
-
MOODLE_18_STABLE
Upcoming assignments are not listed in My Moodle. This can be tracked in the code to the function print_overview in course/lib.php. The variable $htmlarray never has assignments set up as it depends on "modinfo" being defined in the $course variable for the function get_all_instances_in_courses in lib/datalib.php.
Existing code follows (from v1.8.2)
my/index.php:
...
$courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', null, false, 21);
...
print_overview($courses);
...
course/lib.php:
...
function print_overview($courses) {
...
$fname = $mod->name.'_print_overview';
if (function_exists($fname)) {
$fname($courses,$htmlarray);
}
...
mod/assignment/lib.php:
...
function assignment_print_overview($courses, &$htmlarray) {
...
if (!$assignments = get_all_instances_in_courses('assignment',$courses)) {
return;
}
lib/datalib.php
function get_all_instances_in_courses($modulename, $courses, $userid=NULL, $includeinvisible=false) {
...
if (!$modinfo = unserialize((string)$course->modinfo)) {
continue;
}
...
I was able to fix this bug by changing the fields in the original get_my_courses function call as such:
$courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, 21);
Obviously, the "*" could be restricted even more for speed, but this simple fix will show the difference when you reload My Moodle.
- duplicates
-
MDL-10232 modinfo missing in get_my_courses
- Closed