user-edit MDL-22118 Fixed fatal error in user/edit.php with unassigned users
authorSam Hemelryk <sam@moodle.com>
Tue, 20 Apr 2010 03:42:55 +0000 (03:42 +0000)
committerSam Hemelryk <sam@moodle.com>
Tue, 20 Apr 2010 03:42:55 +0000 (03:42 +0000)
user/edit.php

index a5086d9..37588cf 100644 (file)
@@ -169,7 +169,11 @@ if ($usernew = $userform->get_data()) {
     $authplugin = get_auth_plugin($user->auth);
 
     $usernew->timemodified = time();
-    $usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $personalcontext, 'user_profile', $usernew->id);
+
+    // description editor element may not exist!
+    if (isset($usernew->description_editor)) {
+        $usernew = file_postupdate_standard_editor($usernew, 'description', $editoroptions, $personalcontext, 'user_profile', $usernew->id);
+    }
 
     $DB->update_record('user', $usernew);