How to eliminate the "Country" field on the signup page

How to eliminate the "Country" field on the signup page

Nosūtīja Albert Leatherman
Atbilžu skaits: 8

Hi, I'm using the great evolve-D theme with Moodle 3.1. To eliminate the "Country" field on the signup page of my Moodle, I've tried inserting

#id_country{display: none;} 

at Site Administration > Appearance > Themes > evolve-D > General Settings > Custom CSS, but doing so only eliminates the dropdown menu, not the word "Country" and the red asterisk beside it. I've also tried inserting 

#page-login-signup .fcontainer .form-group:nth-childNē {display: none;}

where n is any one of various numbers I've inserted, but that eliminates neither the dropdown nor the word "Country" with the red asterisk.

Any other ideas on how to get rid of that field when a user signs up?

Thanks.

Vidējais novērtējums: -
Atbildot uz Albert Leatherman

Re: How to eliminate the "Country" field on the signup page

Nosūtīja M. Degrange
Try :

#page-login-signup #fitem_id_country {display:none;}
Atbildot uz M. Degrange

Re: How to eliminate the "Country" field on the signup page

Nosūtīja Albert Leatherman

Thanks for the idea. I tried it and it worked cosmetically but unfortunately it broke the signup form, which people can't submit without the required "Country" field. So I deleted some lines of code in /login/signup_form.php that refer to country and that did the trick smaidīgs

Atbildot uz Albert Leatherman

Re: How to eliminate the "Country" field on the signup page

Nosūtīja Howard Miller
Core developers attēls Documentation writers attēls Particularly helpful Moodlers attēls Peer reviewers attēls Plugin developers attēls
If you upgraded to a less ancient version of Moodle you would find that Country is no longer a required field.
Atbildot uz Howard Miller

Re: How to eliminate the "Country" field on the signup page

Nosūtīja Albert Leatherman

I’d love to, but a lot of time and money have been invested in our highly customized Moodle site, including customization to numerous php files. Is there a way to upgrade without losing those customizations?

Atbildot uz Albert Leatherman

Re: How to eliminate the "Country" field on the signup page

Nosūtīja M. Degrange
Having an outdated version is always dangerous because you don't have access to vulnerability fix. So someone might use these vulnerability to do nasty things. I don't know the answer for your question "Is there a way to upgrade without losing those customizations?".

A solution could be to add custom javascript to automatically fill the field.
Atbildot uz Albert Leatherman

Re: How to eliminate the "Country" field on the signup page

Nosūtīja Howard Miller
Core developers attēls Documentation writers attēls Particularly helpful Moodlers attēls Peer reviewers attēls Plugin developers attēls
And this... is exactly why you should not customise core files bēdīgs

Yes and no - firstly, I hope you used a version control system to track your changes. If not, you will have to get *exactly* the non-modified version of the Moodle code and make a diff. You can then apply this diff to a new version of Moodle and then spend hours and hours fixing all the problems this will introduce. It's probably quicker to take a clean copy of 3.8 and write all new plugins to create your functionality.
Atbildot uz Albert Leatherman

Re: How to eliminate the "Country" field on the signup page

Nosūtīja Jon Bolton
Particularly helpful Moodlers attēls Testers attēls

If you’re not interested in the user’s country, you could set the default country (https://docs.moodle.org/31/en/Location) to any one of your choices and then use the css above to hide it on the sign up page. That way everyone will have a country stored in their profile so it won’t break the requirement to have one.

I would go one further with the css though, and just use 

#fitem_id_country {display:none;}

which will remove it from the signup page and the user profile page.