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:
@@ -61,7 +61,7 @@ class folder_updated extends \core\event\base {
|
||||
* @return \moodle_url
|
||||
*/
|
||||
public function get_url() {
|
||||
return new \moodle_url('/mod/folder/edit.php', array('id' => $this->context->instanceid));
|
||||
return new \moodle_url('/mod/folder/edit.php', array('id' => $this->contextinstanceid));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ class folder_updated extends \core\event\base {
|
||||
* @return array|null
|
||||
*/
|
||||
protected function get_legacy_logdata() {
|
||||
return array($this->courseid, 'folder', 'edit', 'edit.php?id=' . $this->context->instanceid, $this->objectid,
|
||||
$this->context->instanceid);
|
||||
return array($this->courseid, 'folder', 'edit', 'edit.php?id=' . $this->contextinstanceid, $this->objectid,
|
||||
$this->contextinstanceid);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user