MDL-45445 events: added missing 'other' validation
This commit is contained in:
@@ -105,4 +105,18 @@ class course_created extends base {
|
||||
protected function get_legacy_logdata() {
|
||||
return array(SITEID, 'course', 'new', '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