From: moodler Date: Thu, 17 Apr 2003 13:20:26 +0000 (+0000) Subject: Robustness for $course variable X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7226ce02b182807f6ad85ee147f9a37d65c5481a;p=moodle.git Robustness for $course variable --- diff --git a/course/edit.html b/course/edit.html index c1cf479fe3..ec449f003e 100644 --- a/course/edit.html +++ b/course/edit.html @@ -135,5 +135,5 @@ "> - + diff --git a/course/edit.php b/course/edit.php index 80cbd10431..695cd13b86 100644 --- a/course/edit.php +++ b/course/edit.php @@ -22,6 +22,8 @@ if (!iscreator()) { error("Only administrators and teachers can use this page"); } + + $course = NULL; } if (! $site = get_site()) { @@ -29,6 +31,8 @@ } + + /// If data submitted, then process and store. if ($form = data_submitted()) { @@ -112,6 +116,7 @@ $form->newsitems = 5; $form->showrecent = 1; $form->category = 1; + $form->id = ""; } } @@ -131,7 +136,7 @@ $straddnewcourse = get_string("addnewcourse"); $stradministration = get_string("administration"); - if (isset($course)) { + if (!empty($course)) { print_header($streditcoursesettings, "$course->fullname", "wwwroot/course/view.php?id=$course->id\">$course->shortname -> $streditcoursesettings", $focus);