Skip to content

Commit

Permalink
Merge branch 'MDL-44272-master' of git://github.com/ankitagarwal/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Mar 4, 2014
2 parents 3071e2b + df9a6c0 commit f1284d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions course/tests/courselib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@ public function test_course_module_created_event() {
$this->assertEquals($cm->id, $event->objectid);
$this->assertEquals($USER->id, $event->userid);
$this->assertEquals('course_modules', $event->objecttable);
$url = new moodle_url('/mod/assign/view.php', array('id' => $mod->id));
$url = new moodle_url('/mod/assign/view.php', array('id' => $cm->id));
$this->assertEquals($url, $event->get_url());

// Test legacy data.
Expand All @@ -1963,7 +1963,7 @@ public function test_course_module_created_event() {
$eventdata->userid = $USER->id;
$this->assertEventLegacyData($eventdata, $event);

$arr = array($cm->course, "course", "add mod", "../mod/assign/view.php?id=$mod->id", "assign $cm->instance");
$arr = array($cm->course, "course", "add mod", "../mod/assign/view.php?id=$cm->id", "assign $cm->instance");
$this->assertEventLegacyLogData($arr, $event);
$this->assertEventContextNotUsed($event);

Expand Down Expand Up @@ -2056,7 +2056,7 @@ public function test_course_module_updated_event() {
$this->assertEquals($cm->id, $event->objectid);
$this->assertEquals($USER->id, $event->userid);
$this->assertEquals('course_modules', $event->objecttable);
$url = new moodle_url('/mod/forum/view.php', array('id' => $mod->id));
$url = new moodle_url('/mod/forum/view.php', array('id' => $cm->id));
$this->assertEquals($url, $event->get_url());

// Test legacy data.
Expand All @@ -2069,7 +2069,7 @@ public function test_course_module_updated_event() {
$eventdata->userid = $USER->id;
$this->assertEventLegacyData($eventdata, $event);

$arr = array($cm->course, "course", "update mod", "../mod/forum/view.php?id=$mod->id", "forum $cm->instance");
$arr = array($cm->course, "course", "update mod", "../mod/forum/view.php?id=$cm->id", "forum $cm->instance");
$this->assertEventLegacyLogData($arr, $event);
$this->assertEventContextNotUsed($event);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/event/course_module_created.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/' . $this->other['modulename'] . '/view.php', array('id' => $this->other['instanceid']));
return new \moodle_url('/mod/' . $this->other['modulename'] . '/view.php', array('id' => $this->objectid));
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function get_legacy_eventdata() {
*/
protected function get_legacy_logdata() {
return array ($this->courseid, "course", "add mod", "../mod/" . $this->other['modulename'] . "/view.php?id=" .
$this->other['instanceid'], $this->other['modulename'] . " " . $this->other['instanceid']);
$this->objectid, $this->other['modulename'] . " " . $this->other['instanceid']);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/classes/event/course_module_updated.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function get_description() {
* @return \moodle_url
*/
public function get_url() {
return new \moodle_url('/mod/' . $this->other['modulename'] . '/view.php', array('id' => $this->other['instanceid']));
return new \moodle_url('/mod/' . $this->other['modulename'] . '/view.php', array('id' => $this->objectid));
}

/**
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function get_legacy_eventdata() {
*/
protected function get_legacy_logdata() {
return array ($this->courseid, "course", "update mod", "../mod/" . $this->other['modulename'] . "/view.php?id=" .
$this->other['instanceid'], $this->other['modulename'] . " " . $this->other['instanceid']);
$this->objectid, $this->other['modulename'] . " " . $this->other['instanceid']);
}

/**
Expand Down

0 comments on commit f1284d3

Please sign in to comment.