MDL-61305 modinfo: Add back missing require for course
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 12 Feb 2018 02:38:33 +0000 (10:38 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 12 Feb 2018 02:39:51 +0000 (10:39 +0800)
lib/modinfolib.php

index a0cedf2..98ef37e 100644 (file)
@@ -653,7 +653,8 @@ class course_modinfo {
      * @return stdClass Course object that has been stored in MUC
      */
     protected static function inner_build_course_cache($course, \core\lock\lock $lock) {
-        global $DB;
+        global $DB, $CFG;
+        require_once("{$CFG->dirroot}/course/lib.php");
 
         // Ensure object has all necessary fields.
         foreach (self::$cachedfields as $key) {