Merge branch 'master_check_cached_empty_modnames' of https://github.com/opitz/moodle

This commit is contained in:
Jun Pataleta
2024-02-07 11:18:00 +08:00
+1 -1
View File
@@ -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) {