MDL-25921 show error when module table is missing

This commit is contained in:
Petr Skoda
2011-01-30 13:02:42 +01:00
parent 8cdc85ac62
commit c259e5f636
+8 -3
View File
@@ -141,12 +141,17 @@
$settings = "";
}
$count = $DB->count_records_select($module->name, "course<>0");
try {
$count = $DB->count_records_select($module->name, "course<>0");
} catch (dml_exception $e) {
$count = -1;
}
if ($count>0) {
$countlink = "<a href=\"{$CFG->wwwroot}/course/search.php?modulelist=$module->name" .
"&amp;sesskey=".sesskey()."\" title=\"$strshowmodulecourse\">$count</a>";
}
else {
} else if ($count < 0) {
$countlink = get_string('error');
} else {
$countlink = "$count";
}