From ebb32067bf928b0decaa406ea3f281fa14bf2f4f Mon Sep 17 00:00:00 2001 From: Sergey Vidusov Date: Wed, 1 Dec 2010 10:56:15 +1030 Subject: [PATCH] MDL-25478 - stop fatal errors adding blocks on the module edit page Signed-off-by: Dan Poltawski --- course/modedit.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/course/modedit.php b/course/modedit.php index d6338e66643..4b5c615df2b 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -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);