Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.6.4, 3.6.5
-
None
-
MOODLE_36_STABLE
Description
When the event course_module_deleted is triggered the event is missing the 'name' attribute.
The event is created here:
// course/lib.php ~1208
|
$event = \core\event\course_module_deleted::create(array(
|
'courseid' => $cm->course, |
'context' => $modcontext, |
'objectid' => $cm->id, |
'other' => array( |
'modulename' => $modulename, |
'instanceid' => $cm->instance, |
)
|
));
|
When you compare it with the implementation in
// course/tests/courselib_test.php
|
$event = \core\event\course_module_deleted::create(array(
|
'courseid' => $modinfo->course, |
'context' => $context, |
'objectid' => $modinfo->coursemodule, |
'other' => array( |
'modulename' => 'assign', |
'name' => 'My assignment', |
)
|
));
|
Or compared with course_module_updated
// lib/classes/event/course_module_updated.php ~148
|
$event = static::create(array( |
'context' => $modcontext, |
'objectid' => $cm->id, |
'other' => array( |
'modulename' => $cm->modname, |
'instanceid' => $cm->instance, |
'name' => $cm->name, |
)
|
));
|
I think it would be very useful for many use-cases to have the cm name directly in the event. Additionally it would be consistent with course_module_updated and course_module_created.