mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-42560 Events: Removed use of role->name
role->name is usually empty or localized, so should not be used in events
This commit is contained in:
parent
68291f2d57
commit
045d913d11
@ -201,8 +201,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey() && $de
|
||||
$event = \core\event\role_capabilities_updated::create(
|
||||
array(
|
||||
'context' => $systemcontext,
|
||||
'objectid' => $roleid,
|
||||
'other' => array('name' => $definitiontable->get_role_name())
|
||||
'objectid' => $roleid
|
||||
)
|
||||
);
|
||||
$event->set_legacy_logdata(array(SITEID, 'role', $action, 'admin/roles/define.php?action=view&roleid=' . $tableroleid,
|
||||
|
@ -130,8 +130,7 @@ if (optional_param('savechanges', false, PARAM_BOOL) && confirm_sesskey()) {
|
||||
array(
|
||||
'context' => $context,
|
||||
'objectid' => $roleid,
|
||||
'courseid' => $courseid,
|
||||
'other' => array('name' => $rolename)
|
||||
'courseid' => $courseid
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -1528,7 +1528,6 @@ function delete_role($roleid) {
|
||||
'objectid' => $roleid,
|
||||
'other' =>
|
||||
array(
|
||||
'name' => $role->name,
|
||||
'shortname' => $role->shortname,
|
||||
'description' => $role->description,
|
||||
'archetype' => $role->archetype
|
||||
|
@ -699,7 +699,6 @@ class core_accesslib_testcase extends advanced_testcase {
|
||||
$this->assertSame('role', $event->objecttable);
|
||||
$this->assertSame($role->id, $event->objectid);
|
||||
$this->assertEquals(context_system::instance(), $event->get_context());
|
||||
$this->assertSame($role->name, $event->other['name']);
|
||||
$this->assertSame($role->shortname, $event->other['shortname']);
|
||||
$this->assertSame($role->description, $event->other['description']);
|
||||
$this->assertSame($role->archetype, $event->other['archetype']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user