Skip to content

Commit

Permalink
MDL-45607 events: changed the context passed to the user_profile_view…
Browse files Browse the repository at this point in the history
…ed event
  • Loading branch information
mdjnelson committed May 21, 2014
1 parent ba05f57 commit 4a9dcf3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/classes/event/user_profile_viewed.php
Expand Up @@ -54,7 +54,7 @@ public static function get_name() {
*/
public function get_description() {
return 'User ' . $this->userid . ' viewed the profile for user ' . $this->relateduserid . ' in the course ' .
$this->other['courseid'];
$this->courseid;
}

/**
Expand All @@ -63,7 +63,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/user/view.php', array('id' => $this->relateduserid, 'course' => $this->other['courseid']));
return new \moodle_url('/user/view.php', array('id' => $this->relateduserid, 'course' => $this->courseid));
}

/**
Expand All @@ -72,7 +72,7 @@ public function get_url() {
* @return array
*/
protected function get_legacy_logdata() {
return array($this->other['courseid'], 'user', 'view', 'view.php?id=' . $this->relateduserid . '&course=' .
$this->other['courseid'], $this->relateduserid);
return array($this->courseid, 'user', 'view', 'view.php?id=' . $this->relateduserid . '&course=' .
$this->courseid, $this->relateduserid);
}
}
3 changes: 2 additions & 1 deletion user/view.php
Expand Up @@ -191,7 +191,8 @@
$event = \core\event\user_profile_viewed::create(array(
'objectid' => $USER->id,
'relateduserid' => $user->id,
'context' => $usercontext,
'courseid' => $course->id,
'context' => $coursecontext,
'other' => array(
'courseid' => $course->id,
'courseshortname' => $course->shortname,
Expand Down

0 comments on commit 4a9dcf3

Please sign in to comment.