acf-city-selector
acf-city-selector copied to clipboard
I see countries but not cities
Hey, I've added a few cities. When I set the field and select "All fields [default]" under "Fields to use", I see the Country > Region > City perfectly. When I select "Country + City" I can select country, but the cities list is empty.
See this short video with screen capture for more details: https://sharing.clickup.com/clip/p/t1866731/c9951cd2-4013-47e7-968d-104e255c9f41/screen-recording-2022-08-13-10%3A11.webm
What am I doing wrong?
Thanks
"What you're doing wrong", is hard to determine based on this explanation.
Try removing all countries and import a new one.
I tried what you suggested and still have the same issue. Anything else I could check or info I can send to make the situation more clear?
Thanks
I have seen your screencast, but I can not reproduce this is a sandbox environment.
I get all cities in Holland, when country + city are selected. See screenshot.
I saw you use Gutenberg... The only thing I can think of right now, (but I think chances are small) is that that interferes in some way, but wouldn't see how.
Thanks for the effort but still the same for me. I even tried reinstalling the plugin. Do you know of a simple way to create a dropdown of Country and Cities cascaded under the country? Like creating categories.
Do you have an error log open or a console log ? Something must go wrong...
Did you also remove your custom country ? Maybe something goes wrong because of an incorrect import or something (just spitballing here...)
The plugin is being used by several other people, I bet this would have come up if it was an issue with the plugin so I do think it's on your end. I'd love to help if I know what's going wrong, but can't tell based on this info, sorry.
I appreciate your help and sure the plugin works.
It's a new website with almost no other plugins installed. I tried deactivating any unrelated plugin, set the default theme, I've removed any data from the plug-in, and imported only the free list for the Netherlands.
I've set an error log plugin. I played around with the plugin, ACF, and the post and there were no errors The city selection works with all the options, except when I select "Country + City" under "Fields to use".
Can u try installing the classic editor plugin (to disable gutenberg) ? Not sure if that is affected but I always disable it and did all tests without GB.
I will see if I can reproduce this with Gutenberg later on.
I've set an error log plugin.
You don't need a plugin, just add
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
to wp-config.php. Explained here.
Then an error log will be written to /wp-content/debug.log
.
Thanks, still nothing in the log file.
I just tried it with Gutenberg active, but it still works on my end.
Which ACF version do you use ?
I tested with both v4 and v5, both work, with/without classic editor. I have no idea what it could be.
Thank you very much for the effort. I have no idea what's the issue. Worth case I might reinstall WP from scratch. This site is completely new.
Have you been able to fix it in the meanwhile ?
Hi, No. I just created a simple dropdown for countries.
On Tue, Sep 20, 2022 at 5:47 PM Beee @.***> wrote:
Have you been able to fix it in the meanwhile ?
— Reply to this email directly, view it on GitHub https://github.com/Beee4life/acf-city-selector/issues/108#issuecomment-1252466767, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXRKOBKPQP5I2U7Y7HQPMDV7HE7FANCNFSM56NV6MJQ . You are receiving this because you authored the thread.Message ID: @.***>
I'm sorry to hear that. I wish I knew what's going on. I still think it's related to the theme you use or some other plugin.
I guess you're right, but I tried it with no other plugins but Elementor.
On Tue, Sep 20, 2022 at 5:58 PM Beee @.***> wrote:
I'm sorry to hear that. I wish I knew what's going on. I still think it's related to the theme you use or some other plugin.
— Reply to this email directly, view it on GitHub https://github.com/Beee4life/acf-city-selector/issues/108#issuecomment-1252485081, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXRKOE3P72WCYAHUDSL2VLV7HGKVANCNFSM56NV6MJQ . You are receiving this because you authored the thread.Message ID: @.***>
That might explain it partially. Have you tried it without ?
I don't remember. I think I did but I'm not sure.
On Tue, Sep 20, 2022 at 7:37 PM Beee @.***> wrote:
That might explain it partially. Have you tried it without ?
— Reply to this email directly, view it on GitHub https://github.com/Beee4life/acf-city-selector/issues/108#issuecomment-1252614852, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKXRKOFZRODGJXRB34NIILTV7HR3ZANCNFSM56NV6MJQ . You are receiving this because you authored the thread.Message ID: @.***>
I'd recommend trying it in a fresh install. Only thing I can recommend now I think.
This happened to me too, its a problem with the front-end js when using acf_form() function.
I solved myself changing the .js from acf-city-selector: When country_city method is selected and used acf_form() function for front-end display, the ajax function called is get_state_code instead of get_city_code, I changed the inArray 'all' from the first casuistic to the second one and now it loads correctly.
If you want more details ask me and I will send you the js modified file.
When country_city method is selected and used acf_form() function for front-end display, the ajax function called is get_state_code instead of get_city_code, I changed the inArray 'all' from the first casuistic to the second one and now it loads correctly.
I did not know that. I will look into that.
I have this problem with the Belgium cities. I use the Netherlands and Belgium. The Dutch cities are all visible, but the Belgium cities are invisible. I tried to delete everything and import it again, but didn't solve the problem.
This happened to me too, its a problem with the front-end js when using acf_form() function.
I solved myself changing the .js from acf-city-selector: When country_city method is selected and used acf_form() function for front-end display, the ajax function called is get_state_code instead of get_city_code, I changed the inArray 'all' from the first casuistic to the second one and now it loads correctly.
If you want more details ask me and I will send you the js modified file.
Can you please explain to me how to do this?
Created a pull request, check it out @jlb-1985 @Beee4life