MDL-44321 events: cleaning up course_module_viewed event
This commit is contained in:
@@ -96,6 +96,10 @@ abstract class course_module_viewed extends base {
|
||||
if (empty($this->objectid) || empty($this->objecttable)) {
|
||||
throw new \coding_exception('course_module_viewed event must define objectid and object table.');
|
||||
}
|
||||
// Make sure the context level is set to module.
|
||||
if ($this->contextlevel != CONTEXT_MODULE) {
|
||||
throw new \coding_exception('Context passed must be module context.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user