diff --git a/admin/roles/classes/define_role_table_advanced.php b/admin/roles/classes/define_role_table_advanced.php index 06f565d59a5..d18c144402d 100644 --- a/admin/roles/classes/define_role_table_advanced.php +++ b/admin/roles/classes/define_role_table_advanced.php @@ -422,6 +422,12 @@ class core_role_define_role_table_advanced extends core_role_capability_table_wi } else { // Updating role. $DB->update_record('role', $this->role); + + // This will ensure the course contacts cache is purged so name changes get updated in + // 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. + coursecat::role_assignment_changed($this->role->id, context_system::instance()); } // Assignable contexts. diff --git a/course/lib.php b/course/lib.php index bee61328d7a..21c44813573 100644 --- a/course/lib.php +++ b/course/lib.php @@ -2519,6 +2519,8 @@ function save_local_role_names($courseid, $data) { $rolename->name = $value; $DB->insert_record('role_names', $rolename); } + // This will ensure the course contacts cache is purged.. + coursecat::role_assignment_changed($roleid, $context); } }