Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10503

Upcoming assignments do not show in "My Moodle" page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor 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.

            dougiamas Martin Dougiamas
            nwhitt Nick Whitt
            Stephen Bourget Stephen Bourget
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.