MDL-45445 events: added missing 'other' validation
This commit is contained in:
@@ -100,4 +100,18 @@ class course_deleted extends base {
|
||||
protected function get_legacy_logdata() {
|
||||
return array(SITEID, 'course', 'delete', 'view.php?id=' . $this->objectid, $this->other['fullname'] . '(ID ' . $this->objectid . ')');
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom validation.
|
||||
*
|
||||
* @throws \coding_exception
|
||||
* @return void
|
||||
*/
|
||||
protected function validate_data() {
|
||||
parent::validate_data();
|
||||
|
||||
if (!isset($this->other['fullname'])) {
|
||||
throw new \coding_exception('The \'fullname\' value must be set in other.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user