MDL-45319 events: added debugging messages for missing relateduserid value

This commit is contained in:
Mark Nelson
2014-05-07 16:28:59 +08:00
committed by Marina Glancy
parent f1e0f66ca8
commit 425e761712
4 changed files with 36 additions and 1 deletions
+15
View File
@@ -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;
}
}
}