From 1dd99728898af44267d1f56518be8dcf38956852 Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 31 May 2006 10:34:05 +0000 Subject: [PATCH] Check for errors before doing other processing. (Compare this with the add case.) --- course/mod.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/course/mod.php b/course/mod.php index 21cde8078e..935b326786 100644 --- a/course/mod.php +++ b/course/mod.php @@ -98,6 +98,9 @@ } error("Could not update the $mod->modulename", "view.php?id=$course->id"); } + if (is_string($return)) { + error($return, "view.php?id=$course->id"); + } if (isset($mod->visible)) { set_coursemodule_visible($mod->coursemodule, $mod->visible); @@ -107,10 +110,6 @@ set_coursemodule_groupmode($mod->coursemodule, $mod->groupmode); } - if (is_string($return)) { - error($return, "view.php?id=$course->id"); - } - if (isset($mod->redirect)) { $SESSION->returnpage = $mod->redirecturl; } else { -- 2.39.5