Beee4life / acf-city-selector

An ACF extension to create a new field type, where you can select a city based on country and provence/state.
37 stars 15 forks source link

States or cities not visible #134

Open jlb-1985 opened 1 month ago

jlb-1985 commented 1 month ago

Suddenly there is a problem with showing the states or cities. First it wouldn't show the cities, someone else here helped me adjust a js. file. the cities were visible again, but now the states aren't visible and sometimes both aren't visible.

image

jlb-1985 commented 1 month ago

https://github.com/Beee4life/acf-city-selector/pull/133/commits

Someone else was so kind to help Here are his solutions, but unfortunately it didn't fix the whole problem

jlb-1985 commented 1 month ago

Hi, can you please help me with this. My website is online and this function needs to work so companies are showing up by searching via states in the search forms.

Beee4life commented 1 month ago

I don't really understand why this person has removed the option to show all fields. I haven't tested it, but I would never suggest that.

I don't get any of the errors you have. Here it works as expected and I can't reproduce your issue.

jlb-1985 commented 1 month ago

I deactived all the plugins except city selector, taxonomy and ACF. To rule out that it was a plugin conflict, but there was no change. I deleted City Selector, downloaded the newest version again. Country and States are visible, but the cities aren't, just like te first time.

What can I do more? Can you log in to my website and figure out what te problem is?

jlb-1985 commented 1 month ago

I'm searching and searching for the possible problem. I'm not a developer , but going trough the files hoping to see something.

image

Is this something? Behind Country and State is the word 'Code'' And City had the word 'Name'

It's in the field validation.js

jlb-1985 commented 1 month ago

Found a solution but it gives me a new problem. I understand where the problem started. First I only used the netherlands and recently I added Belgium and then I got this problem.

The cities shows up again if I set 1 country as default in ACF. So If I set The Netherlands as default in ACF I get the states and the cities of the Netherlands in the backend of the posts. But if I select Belgium in the backend of the posts, it doesn't change the states and cities into Belgium ones

And vice versa. If I set Belgium as default country in ACF, I get Belgium states and cities in the backend of the posts, but if I select the Netherlands in the backend of the post, it doesn;t change the states and cities in Belgium one. image

image

image

Beee4life commented 1 month ago

The cities shows up again if I set 1 country as default in ACF. So If I set The Netherlands as default in ACF I get the states and the cities of the Netherlands in the backend of the posts. But if I select Belgium in the backend of the posts, it doesn't change the states and cities into Belgium ones

Ok that helps. I will look into this and test it.

Beee4life commented 1 month ago

I tested it locally.
I set NL as default.
I selected Belgium, a state and a city.
All without any errors.

Screenshot 2024-05-27 at 20 38 26

Beee4life commented 1 month ago

What theme do you use ? I use twentytwelve for 'sandbox purposes'.

And do you use Gutenberg ?

jlb-1985 commented 1 month ago

I use divi as theme. Yes I use Gutenberg

Beee4life commented 1 month ago

I think Divi might be involved... it loads a lot of crap/js. Can you plz test with a default WP theme ?

Also I have never tested with Gutenberg so can't guarantee its workings (for now).

jlb-1985 commented 1 month ago

That could be the problem. I will test it tonight or this weekend.