From 76f5232c947ee9f09915cb78806c39889ab44065 Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Thu, 18 Jan 2024 12:31:37 +0000 Subject: [PATCH] MDL-79988 course: checking for cached empty modnames Check if empty modnames have been cached and if so retrieve them again. --- course/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/course/lib.php b/course/lib.php index 4179702d083..4da81ac5bfd 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) {