diff --git a/admin/roles/classes/define_role_table_advanced.php b/admin/roles/classes/define_role_table_advanced.php index d18c144402d..eb46c76be9e 100644 --- a/admin/roles/classes/define_role_table_advanced.php +++ b/admin/roles/classes/define_role_table_advanced.php @@ -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()); }