Merge branch 'MDL-52370-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
David Monllao 2015-12-07 15:01:42 +08:00
commit 7e092a97d7
2 changed files with 8 additions and 0 deletions

View File

@ -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.

View File

@ -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);
}
}