MDL-43557 events: fixed minor issues in existing events

This commit is contained in:
Mark Nelson
2014-04-29 19:16:11 -07:00
parent 4d9c1b573e
commit 02a5a4b2ff
319 changed files with 2616 additions and 1982 deletions
+8 -8
View File
@@ -33,9 +33,9 @@ defined('MOODLE_INTERNAL') || die();
* @property-read array $other {
* Extra information about event.
*
* @type string modulename name of module updated.
* @type string name title of module.
* @type string instanceid id of module instance.
* - string modulename: name of module updated.
* - string name: title of module.
* - string instanceid: id of module instance.
* }
*
* @package core
@@ -69,8 +69,8 @@ class course_module_updated extends base {
* @return string
*/
public function get_description() {
return 'The ' . $this->other['modulename'] . ' module with instance id ' . $this->other['instanceid'] .
' was updated by user with id ' . $this->userid;
return "The user with the id '$this->userid' updated the '{$this->other['modulename']}' activity with the " .
"course module id '$this->contextinstanceid'.";
}
/**
@@ -127,13 +127,13 @@ class course_module_updated extends base {
protected function validate_data() {
parent::validate_data();
if (!isset($this->other['modulename'])) {
throw new \coding_exception("Field other['modulename'] cannot be empty");
throw new \coding_exception('The \'modulename\' value must be set in other.');
}
if (!isset($this->other['instanceid'])) {
throw new \coding_exception("Field other['instanceid'] cannot be empty");
throw new \coding_exception('The \'instanceid\' value must be set in other.');
}
if (!isset($this->other['name'])) {
throw new \coding_exception("Field other['name'] cannot be empty");
throw new \coding_exception('The \'name\' value must be set in other.');
}
}