MDL-53010 core_role: add missing coursecatlib include
authorSimey Lameze <simey@moodle.com>
Mon, 29 Feb 2016 06:25:45 +0000 (14:25 +0800)
committerSimey Lameze <simey@moodle.com>
Mon, 29 Feb 2016 06:25:45 +0000 (14:25 +0800)
admin/roles/classes/define_role_table_advanced.php

index d18c144..eb46c76 100644 (file)
@@ -413,7 +413,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
     }
 
     public function save_changes() {
-        global $DB;
+        global $DB, $CFG;
 
         if (!$this->roleid) {
             // Creating role.
@@ -427,6 +427,7 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi
             // the UI. It would be better to do this only when we know that fields affected are
             // updated. But thats getting into the weeds of the coursecat cache and role edits
             // should not be that frequent, so here is the ugly brutal approach.
+            require_once($CFG->libdir . '/coursecatlib.php');
             coursecat::role_assignment_changed($this->role->id, context_system::instance());
         }