MDL-52370 course: purge contacts cache on role rename
authorDan Poltawski <dan@moodle.com>
Tue, 1 Dec 2015 12:43:32 +0000 (12:43 +0000)
committerDan Poltawski <dan@moodle.com>
Tue, 1 Dec 2015 12:44:34 +0000 (12:44 +0000)
Previously teachers would rename roles and the change would not be
reflected in course listings.

course/lib.php

index ba830ca..851ed52 100644 (file)
@@ -2486,6 +2486,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);
     }
 }