MDL-45319 events: added debugging messages for missing relateduserid value
This commit is contained in:
committed by
Marina Glancy
parent
f1e0f66ca8
commit
425e761712
@@ -98,4 +98,19 @@ class user_created extends base {
|
||||
protected function get_legacy_logdata() {
|
||||
return array(SITEID, 'user', 'add', '/view.php?id='.$this->objectid, fullname($this->get_legacy_eventdata()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom validation.
|
||||
*
|
||||
* @throws \coding_exception
|
||||
* @return void
|
||||
*/
|
||||
protected function validate_data() {
|
||||
parent::validate_data();
|
||||
|
||||
if (!isset($this->relateduserid)) {
|
||||
debugging('The \'relateduserid\' value must be specified in the event.', DEBUG_DEVELOPER);
|
||||
$this->relateduserid = $this->objectid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user