Index: lib/moodlelib.php =================================================================== --- lib/moodlelib.php (date 1327530359000) +++ lib/moodlelib.php (revision ) @@ -4753,9 +4753,8 @@ // Look in every instance of every module for data to delete $unsupported_mods = array(); - if ($allmods = $DB->get_records('modules') ) { - foreach ($allmods as $mod) { - $modname = $mod->name; + if ($allmods = get_plugin_list('mod') ) { + foreach ($allmods as $modname) { if (!$DB->count_records($modname, array('course'=>$data->courseid))) { continue; // skip mods with no instances } @@ -4771,7 +4770,7 @@ debugging('Module '.$modname.' returned incorrect staus - must be an array!'); } } else { - $unsupported_mods[] = $mod; + $unsupported_mods[] = $modname; } } else { debugging('Missing lib.php in '.$modname.' module!'); @@ -4781,8 +4780,8 @@ // mention unsupported mods if (!empty($unsupported_mods)) { - foreach($unsupported_mods as $mod) { - $status[] = array('component'=>get_string('modulenameplural', $mod->name), 'item'=>'', 'error'=>get_string('resetnotimplemented')); + foreach($unsupported_mods as $modname) { + $status[] = array('component'=>get_string('modulenameplural', $modname), 'item'=>'', 'error'=>get_string('resetnotimplemented')); } }