I didn't see an interface specific forum, so I figured I'd post this here.
We'd like to change certain required profile fields (city, country, description) to optional. What's the best way of doing that?
We've found that these fields are causing confusion and headaches with students (particularly the description field, which most don't want to update, but are forced to change if they want to make other tweaks to their profile).
Hi Kenneth,
this is indeed a royal pain - especially when the red-box-around error is not visible onscreen (it is up at the top of the page).
Have you been able to find a workaround? Surely the 'compulsory' tag is available to edit in some settings? I've been searching but cannot find an answer. THanks!
this is indeed a royal pain - especially when the red-box-around error is not visible onscreen (it is up at the top of the page).
Have you been able to find a workaround? Surely the 'compulsory' tag is available to edit in some settings? I've been searching but cannot find an answer. THanks!
I too am searching for an answer for this. If anyone has a workaround, I'd love to see it... this is proving a major problem with our incoming freshmen.
If you haven't found an answer yet, you can try editing the "useredit_shared_definition()" function in the user/editlib.php approx line 57, commenting out the code that makes it required.
For example to make 'city' not required you'd change:
$mform->addRule('city', $strrequired, 'required', null, 'client');
to
//$mform->addRule('city', $strrequired, 'required', null, 'client');
I haven't fully tested but this looks like it'd work as a last resort.
For example to make 'city' not required you'd change:
$mform->addRule('city', $strrequired, 'required', null, 'client');
to
//$mform->addRule('city', $strrequired, 'required', null, 'client');
I haven't fully tested but this looks like it'd work as a last resort.
You will also need to do this in the file edit_form.php if you want the Description field not to be compulsory.
Thanks Ian, you just saved me a lot of time!
Why isn't that line in editlib.php with all the others?
Why isn't that line in editlib.php with all the others?
Hi Micheal,
I tried doing what you said here but for the lastname feild, but it doesnt work. I am using Moodle 1.9.5
Do you have any ideas please?
Thanks
I tried doing what you said here but for the lastname feild, but it doesnt work. I am using Moodle 1.9.5
Do you have any ideas please?
Thanks
i just edit in:
editlib.php line 97
//$mform->addRule('lastname', $strrequired, 'required', null, 'client');
moodlelib.php line 2290
function user_not_fully_set_up($user) {
//or empty($user->lastname)
return ($user->username != 'guest' and (empty($user->firstname) or empty($user->email) or over_bounce_threshold($user)));
}
it's working, it doesn't redirect any more.
i'm using 1.9.4 moodle version
i wish this help you
sorry for my poorly english
regards
editlib.php line 97
//$mform->addRule('lastname', $strrequired, 'required', null, 'client');
moodlelib.php line 2290
function user_not_fully_set_up($user) {
//or empty($user->lastname)
return ($user->username != 'guest' and (empty($user->firstname) or empty($user->email) or over_bounce_threshold($user)));
}
it's working, it doesn't redirect any more.
i'm using 1.9.4 moodle version
i wish this help you
sorry for my poorly english
regards
thanks you very much. it's really a big help.
Are you sure it worked. I tried the same way you did ,it didn't work for me. Is there any other files that i need to edit to make it work.
regards