Merge branch 'MDL-61305-master-fix' of https://github.com/andrewnicols/moodle

This commit is contained in:
Andrew Nicols 2018-02-12 11:30:53 +08:00
commit f675a8e23a

View 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) {