$modulebyname = array();
foreach ($modules as $module) {
+ if (!file_exists("$CFG->dirroot/mod/$module->name/lib.php")) {
+ continue;
+ }
$strmodulename = get_string('modulename', $module->name);
// Deal with modules which are lacking the language string
if ($strmodulename == '[[modulename]]') {
$minimalmodinfo=new stdClass();
$minimalmodinfo->cms=array();
foreach($info as $mod) {
+ if (empty($mod->name)) {
+ // something is wrong here
+ continue;
+ }
$minimalcm = new stdClass();
$minimalcm->id = $mod->cm;
$minimalcm->name = $mod->name;