MDL-43736 Events: event->contextinstanceid should be used where possible

While restoring event context might not be present (deleted)
So before using context api's check context or use event properties
This commit is contained in:
Rajesh Taneja
2014-01-29 11:39:44 +08:00
parent fefcd9abab
commit fdc729ea57
73 changed files with 154 additions and 136 deletions
+3 -3
View File
@@ -72,7 +72,7 @@ abstract class course_module_viewed extends base {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url("/mod/$this->objecttable/view.php", array('id' => $this->context->instanceid));
return new \moodle_url("/mod/$this->objecttable/view.php", array('id' => $this->contextinstanceid));
}
/**
@@ -81,8 +81,8 @@ abstract class course_module_viewed extends base {
* @return array|null
*/
protected function get_legacy_logdata() {
return array($this->courseid, $this->objecttable, 'view', 'view.php?id=' . $this->context->instanceid, $this->objectid,
$this->context->instanceid);
return array($this->courseid, $this->objecttable, 'view', 'view.php?id=' . $this->contextinstanceid, $this->objectid,
$this->contextinstanceid);
}
/**