MDL-53841 assign: Fix for assignment listing page.

Was throwing debugging because there is no course module defined on this page.
This commit is contained in:
Damyon Wiese
2016-04-17 22:35:41 +08:00
parent 4f33514063
commit 77a530601a
+6 -1
View File
@@ -205,7 +205,12 @@ class assign {
public function register_return_link($action, $params) {
global $PAGE;
$params['action'] = $action;
$currenturl = new moodle_url('/mod/assign/view.php', array('id' => $this->get_course_module()->id));
$cm = $this->get_course_module();
if ($cm) {
$currenturl = new moodle_url('/mod/assign/view.php', array('id' => $cm->id));
} else {
$currenturl = new moodle_url('/mod/assign/index.php', array('id' => $this->get_course()->id));
}
$currenturl->params($params);
$PAGE->set_url($currenturl);