Index: course/reset_form.php =================================================================== --- course/reset_form.php (revision 16295) +++ course/reset_form.php (working copy) @@ -58,8 +58,16 @@ if ($allmods = $DB->get_records('modules') ) { foreach ($allmods as $mod) { $modname = $mod->name; - if (!$DB->count_records($modname, array('course'=>$COURSE->id))) { - continue; // skip mods with no instances + try { + if (!$DB->count_records($modname, array('course'=>$COURSE->id))) { + continue; // skip mods with no instances + } + } catch (Exception $e) { + // Exception here probably means the table doesn't exist or doesn't + // have an expected column. This can happen with old modules that + // haven't been updated to 2.x on a site upgraded from 1.x. + // Skip the module and continue. + continue; } $modfile = $CFG->dirroot."/mod/$modname/lib.php"; $mod_reset_course_form_definition = $modname.'_reset_course_form_definition';