MDL-36878 course: fixed issue with module metadata cache
authorSam Hemelryk <sam@moodle.com>
Wed, 28 Nov 2012 23:56:52 +0000 (12:56 +1300)
committerSam Hemelryk <sam@moodle.com>
Wed, 28 Nov 2012 23:57:31 +0000 (12:57 +1300)
Credit goes to Sam Chaffee.

course/lib.php

index 4143375..21fcfcd 100644 (file)
@@ -1921,7 +1921,7 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) {
         if (!course_allowed_module($course, $modname)) {
             continue;
         }
         if (!course_allowed_module($course, $modname)) {
             continue;
         }
-        if (isset($modlist[$modname])) {
+        if (isset($modlist[$course->id][$modname])) {
             // This module is already cached
             $return[$modname] = $modlist[$course->id][$modname];
             continue;
             // This module is already cached
             $return[$modname] = $modlist[$course->id][$modname];
             continue;