I'm trying to completely hide the Country and City/Town settings. They are irrelevant to the project I am working on and will just be annoying to users - also we do not have authority to collect this information of users - so If I cannot hide these fields I will have to provide a communication to all users telling them not to provide these values.
Please help if you know the answer to this - I'm tearing my hair out... I'm sure there must be a simple solution to this - as there seem to be an awful lot of people looking for it!?!
I looked at
and did not see where I could change country or city/town to a hidden field
Could you please post the snipet of the file that shows me how to do this
Thanks in advance for any assistance,
You could add it at the top of user/edit_form.php, next to the block of code that starts with the comment 'Add some extra hidden fields'. But then those fields would be added again in user/editlib.php giving you a nice error.
So you can edit user/editlib.php and search for the block of lines that read:
$mform->addElement('text', 'city', get_string('city'), 'maxlength="20" size="21"'); $mform->setType('city', PARAM_MULTILANG); $mform->addRule('city', $strrequired, 'required', null, 'client');
and simply comment the last line (the addRule line). A few lines below you'll find the code for the country field. Just do the same.