From 072426e0c1e89f4443cb47f829b2e2c6155e83d1 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 8 Aug 2003 16:46:16 +0000 Subject: [PATCH] Fixed up cancel button on module editing page to avoid error when returning to course page. Fix by Scott Elliott. --- course/mod.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/course/mod.php b/course/mod.php index cda0b8c77c..4753f353f1 100644 --- a/course/mod.php +++ b/course/mod.php @@ -7,6 +7,13 @@ require_login(); + if (isset($SESSION->modform)) { // Variables are stored in the session + $mod = $SESSION->modform; + unset($SESSION->modform); + } else { + $mod = (object)$_POST; + } + if (isset($cancel)) { if (!empty($SESSION->returnpage)) { $return = $SESSION->returnpage; @@ -20,13 +27,6 @@ if (isset($_POST["course"])) { // add or update form submitted - if (isset($SESSION->modform)) { // Variables are stored in the session - $mod = $SESSION->modform; - unset($SESSION->modform); - } else { - $mod = (object)$_POST; - } - if (!isteacher($mod->course)) { error("You can't modify this course!"); } -- 2.39.5