From 18b19ff452a86f9c20f28c463d474bcfe030da0b Mon Sep 17 00:00:00 2001 From: Jim Thorpe Date: Thu, 17 Jul 2014 11:57:00 +1200 Subject: [PATCH] enrol_imsenterprise: MDL-46363 including course lib when create_course is used --- enrol/imsenterprise/lib.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/enrol/imsenterprise/lib.php b/enrol/imsenterprise/lib.php index 6db08519456..f6d2d9bfebd 100644 --- a/enrol/imsenterprise/lib.php +++ b/enrol/imsenterprise/lib.php @@ -270,13 +270,16 @@ class enrol_imsenterprise_plugin extends enrol_plugin { * @param string $tagcontents The raw contents of the XML element */ protected function process_group_tag($tagcontents) { - global $DB; + global $DB, $CFG; // Get configs. $truncatecoursecodes = $this->get_config('truncatecoursecodes'); $createnewcourses = $this->get_config('createnewcourses'); $createnewcategories = $this->get_config('createnewcategories'); + if ($createnewcourses) { + require_once("$CFG->dirroot/course/lib.php"); + } // Process tag contents. $group = new stdClass(); if (preg_match('{.*?(.+?).*?}is', $tagcontents, $matches)) {