From ccbb6bd37ea7a961db382355a0a32d65716b83b8 Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Thu, 2 Nov 2023 12:13:45 +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 67c56595351..60d2adea149 100644 --- a/course/lib.php +++ b/course/lib.php @@ -399,7 +399,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) {