From da7fac00eaecc311dbd1ce5b8647122633592919 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 18 Nov 2008 21:32:50 +0000 Subject: [PATCH] MDL-17143 fixed use of $userid in definition_after_data() - problem in 1.8.x is that the definition_after_data() is called 2x ;-) --- user/edit_form.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/user/edit_form.php b/user/edit_form.php index 9d2e3c74523..d46650af898 100644 --- a/user/edit_form.php +++ b/user/edit_form.php @@ -54,15 +54,15 @@ class user_edit_form extends moodleform { } } - // remove description - if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !record_exists('role_assignments', 'userid', $userid)) { - if ($mform->elementExists('description')) { - $mform->removeElement('description'); - } - } - if ($user = get_record('user', 'id', $userid)) { + // remove description - this must be here because + if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !record_exists('role_assignments', 'userid', $user->id)) { + if ($mform->elementExists('description')) { + $mform->removeElement('description'); + } + } + // print picture if (!empty($CFG->gdversion)) { $image_el =& $mform->getElement('currentpicture');