-
Improvement
-
Resolution: Duplicate
-
Major
-
None
-
2.0
-
None
-
MOODLE_20_STABLE
-
Easy
When adding or removing the role of site administrator in http://../moodle/admin/roles/admins.php?section=admins ,
it doesn't throw an event trigger like when other roles are assigned or unassigned.
i managed to do a little peace of code to fix that, is not perfect but it's a start.
here's a preview
// Create a new entry
$ra = new object();
$ra->roleid = 0; // admin
$ra->contextid = 1;
$ra->userid = $confirmdel;
$ra->modifierid = empty($USER->id) ? 0 : $USER->id;
events_trigger('role_unassigned', $ra);
OR events_trigger('role_assigned', $ra);
full file in attachment