diff --git a/course/lib.php b/course/lib.php index c48dda437b0..a8074c50473 100644 --- a/course/lib.php +++ b/course/lib.php @@ -400,7 +400,7 @@ function course_integrity_check($courseid, $rawmods = null, $sections = null, $f function get_module_types_names($plural = false, $resetcache = false) { static $modnames = null; global $DB, $CFG; - if ($modnames === null || $resetcache) { + if ($modnames === null || empty($modnames[0]) || $resetcache) { $modnames = array(0 => array(), 1 => array()); if ($allmods = $DB->get_records("modules")) { foreach ($allmods as $mod) {