Merge branch 'MDL-61305-master-fix' of https://github.com/andrewnicols/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Mon, 12 Feb 2018 03:30:53 +0000 (11:30 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 12 Feb 2018 03:30:53 +0000 (11:30 +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) {