Support

Home Forums Event Espresso Premium Front End Users Can Add new States/Privinces???

Front End Users Can Add new States/Privinces???

Posted: October 2, 2019 at 12:05 am

Viewing 6 reply threads


Ellimatta

October 2, 2019 at 12:05 am

I have an address question group which contains a State/Province drop down but on the front end, non logged in users have a link below it to “click here to add a new State/Province”….

How is this happening. Why would a user be able to add anything to the form?


Ellimatta

October 2, 2019 at 12:05 am

https://www.dropbox.com/s/7dmkvsa8oh35iu8/2019-10-02_16-04-49.png?dl=1


Ellimatta

October 2, 2019 at 12:10 am

Screenshot


Tony

  • Support Staff

October 2, 2019 at 1:32 am

Hi there,

The reason that function was added was we found users were setting the address questions to be required and if EE didn’t have a state saved for the country the user selected, it completely blocked the registration.

The above allows the user to add a state into EE but it’s set not to display to other users, you (as the admin) can then confirm if you want to display that state in Event Espresso -> General Settings -> Countries.

However, EE now pulls all of the states for a country when you enable it in the above setting so its usually not needed, you can remove it from the site using this snippet:

https://gist.github.com/joshfeck/7bf112ee2dc9e49f7e3f14b8c2b59611

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/


Ellimatta

October 3, 2019 at 9:08 pm

Thanks Tony but this is terrible software development!

Forcing a front end change to all users and then making them use custom PHP to stop it… omg really????.

The appropriate way to make such a change would be to add an option to the admin area for users to chose whether or not they want that feature enabled –

    and set it to NO by default

so there is no change unless someone wants it changed….


Ellimatta

October 3, 2019 at 9:11 pm

So now I have to through the all of the sites I manage that use EE and modify their functions.php file to get rid of this spam trap??
Great work guys!


Tony

  • Support Staff

October 4, 2019 at 2:53 am

I guess I wasn’t clear in my reply above, but we haven’t forced any changes here, this functionality has always been in EE.

The add new state microform has been included within EE since version 4.1.x (aka the initial release), it’s not new and we haven’t enabled it with a recent version.

The appropriate way to make such a change would be to add an option to the admin area for users to chose whether or not they want that feature enabled – and set it to NO by default

Your right and that’s exactly what we do when we add/change a feature (leave the default as is and have an option to change it) but this isn’t one of those cases as again, we haven’t added/changed the add state feature recently, its been in core for years.

If you check the date of when the above snippet was created it’s over 3 years ago:

https://gist.github.com/joshfeck/7bf112ee2dc9e49f7e3f14b8c2b59611

See: https://monosnap.com/file/dz0CG93mkrbwyPswmj5MpYsbsfiCnI

so there is no change unless someone wants it changed….

Again, we (Event Espresso) agree with you here for the most part. There are cases in which we are forced to make a breaking/default change but it’s rare and this isn’t one of those cases, we have not changed this functionality.

So now I have to through the all of the sites I manage that use EE and modify their functions.php file to get rid of this spam trap??
Great work guys!

If you enabled states on the registration form previously, you will have always displayed that option on those sites.

Viewing 6 reply threads

The support post ‘Front End Users Can Add new States/Privinces???’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso