]> git.mjollnir.org Git - moodle.git/commitdiff
reverting moved $SITE reinitialisation into setting method, it was not a good idea...
authorskodak <skodak>
Mon, 16 Oct 2006 08:54:37 +0000 (08:54 +0000)
committerskodak <skodak>
Mon, 16 Oct 2006 08:54:37 +0000 (08:54 +0000)
admin/settings.php
lib/adminlib.php

index 3c0107d967cefe05b0c0e607455845ad01d8f9b1..9aec4ca7a4421575ca79a282d50742057d010d84 100644 (file)
@@ -78,7 +78,8 @@ if ($data = data_submitted()) {
     } else {
         error(get_string('confirmsesskeybad', 'error'));
     }
-    //update $COURSE to match changed $SITE
+    // now update $SITE - it might have been changed
+    $SITE = get_record('course', 'id', $SITE->id);
     $COURSE = clone($SITE);
 }
 
index f12edf7739110e67d67f11f8730c1fde2d48dbfe..f5c3cb289dfb73b90b42e571181383491a48e12b 100644 (file)
@@ -1693,10 +1693,7 @@ class admin_setting_sitesettext extends admin_setting_configtext {
         $record->id = $this->id;
         $record->{$this->name} = $data;
         $record->timemodified = time();
-        $status = update_record('course', $record) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />';
-        //now update $SITE
-        global $SITE;
-        $SITE = get_record('course', 'id', $SITE->id);
+        return (update_record('course', $record) ? '' : get_string('errorsetting', 'admin') . $this->visiblename . '<br />');
     }
 
 }