mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-45319 events: added debugging messages for missing relateduserid value
This commit is contained in:
parent
f1e0f66ca8
commit
425e761712
@ -124,6 +124,6 @@ class course_completed extends base {
|
||||
protected function validate_data() {
|
||||
parent::validate_data();
|
||||
|
||||
// TODO: MDL-45319 add validation of relateduserid and other['relateduserid'].
|
||||
// TODO: MDL-45445 add validation of relateduserid and other['relateduserid'].
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -116,6 +116,11 @@ class user_deleted extends base {
|
||||
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;
|
||||
}
|
||||
|
||||
if (!isset($this->other['username'])) {
|
||||
throw new \coding_exception('The \'username\' value must be set in other.');
|
||||
}
|
||||
|
@ -98,4 +98,19 @@ class user_updated extends base {
|
||||
protected function get_legacy_logdata() {
|
||||
return array(SITEID, 'user', 'update', 'view.php?id='.$this->objectid, '');
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user