MDL-25478 - stop fatal errors adding blocks on the module edit page

Signed-off-by: Dan Poltawski <[email protected]>
This commit is contained in:
Sergey Vidusov
2011-01-03 19:09:56 +00:00
committed by Dan Poltawski
parent c63ebd4311
commit ebb32067bf
+5 -3
View File
@@ -42,12 +42,14 @@ if (!empty($return)) {
}
if (!empty($add)) {
$url->param('add', $add);
$PAGE->set_url($url);
$section = required_param('section', PARAM_INT);
$course = required_param('course', PARAM_INT);
$url->param('add', $add);
$url->param('section', $section);
$url->param('course', $course);
$PAGE->set_url($url);
$course = $DB->get_record('course', array('id'=>$course), '*', MUST_EXIST);
$module = $DB->get_record('modules', array('name'=>$add), '*', MUST_EXIST);