MDL-17143 fixed use of $userid in definition_after_data() - problem in 1.8.x is that the definition_after_data() is called 2x ;-)

This commit is contained in:
skodak 2008-11-18 21:32:50 +00:00
parent 4a762cb514
commit da7fac00ea

View file

@ -54,15 +54,15 @@ class user_edit_form extends moodleform {
} }
} }
// remove description if ($user = get_record('user', 'id', $userid)) {
if (empty($user->description) && !empty($CFG->profilesforenrolledusersonly) && !record_exists('role_assignments', 'userid', $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')) { if ($mform->elementExists('description')) {
$mform->removeElement('description'); $mform->removeElement('description');
} }
} }
if ($user = get_record('user', 'id', $userid)) {
// print picture // print picture
if (!empty($CFG->gdversion)) { if (!empty($CFG->gdversion)) {
$image_el =& $mform->getElement('currentpicture'); $image_el =& $mform->getElement('currentpicture');