Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5272

Intermittent database error on /my/ Course Overview page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 2.6.4
    • Block: My courses
    • None
    • MOODLE_26_STABLE

      We are running Moodle 2.6.4, and one instructor is running into an error when she attempts to access /my/, the Course Overview page. It is similar to a problem reported earlier (http://goo.gl/bL8dzM), in that she can still see her list of courses in the navigation.

      No one else has reported the error, and I do not experience it either as an administrator or as an instructor with a large number of course and a number of older courses. She does have enough courses that she sees a "View all courses" link at the bottom of her list of courses in the navigation. I tried suspending her enrollment in enough courses that the "View all courses" link went away, but that didn't help.

      The text of the PHP error message is pasted below. On line 121 of /blocks/my_courses/block_my_courses.php: call to enrol_get_my_courses() is the following call:

      $courses = enrol_get_my_courses('id, shortname, modinfo', $sort_sql, $courses_limit);
      

      And sure enough, modinfo isn't a field in the mdl_course table, but why would that be causing an error for only one user?

      Default exception handler: Error reading from database Debug: Unknown column 'c.modinfo' in 'field list'
      SELECT 
      c.id,c.category,c.sortorder,c.shortname,c.fullname,c.idnumber,c.startdate,c.visible,c.groupmode,c.groupmodeforce,c.cacherev,c.modinfo , ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance
      FROM mdl_course c
      JOIN (SELECT DISTINCT e.courseid
      FROM mdl_enrol e
      JOIN mdl_user_enrolments ue ON (ue.enrolid = e.id AND ue.userid = ?)
             WHERE ue.status = ? AND e.status = ? AND ue.timestart < ? AND (ue.timeend = 0 OR ue.timeend > ?)
      ) en ON (en.courseid = c.id)
      LEFT JOIN mdl_context ctx ON (ctx.instanceid = c.id AND ctx.contextlevel = ?)
                   WHERE c.id <> ?
      ORDER BY c.visible DESC,c.sortorder ASC LIMIT 0, 22
       
      ...
       
      Error code: dmlreadexception
       
      * line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      * line 996 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      * line 599 of /lib/enrollib.php: call to mysqli_native_moodle_database->get_records_sql()
      * line 121 of /blocks/my_courses/block_my_courses.php: call to enrol_get_my_courses()
      * line 296 of /blocks/moodleblock.class.php: call to block_my_courses->get_content()
      * line 238 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
      * line 993 of /lib/blocklib.php: call to block_base->get_content_for_output()
      * line 1045 of /lib/blocklib.php: call to block_manager->create_block_contents()
      * line 353 of /lib/blocklib.php: call to block_manager->ensure_content_created()
      * line 7 of /theme/isucomm/layout/general.php: call to block_manager->region_has_content()
      * line 870 of /lib/outputrenderers.php: call to include()
      * line 800 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
      * line 153 of /my/index.php: call to core_renderer->header()
      

            inceebee Nate Baxley (Inactive)
            rloconne Rebecca O'Connell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

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