Skip to content

Commit

Permalink
Merge branch 'MDL-52370-master' of git://github.com/danpoltawski/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Dec 7, 2015
2 parents 2ceaa57 + 8f2c99d commit 7e092a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions admin/roles/classes/define_role_table_advanced.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,12 @@ public function save_changes() {
} 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.
Expand Down
2 changes: 2 additions & 0 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 7e092a9

Please sign in to comment.