Only country listed? Australia #381

Open
rpoelking opened this Issue May 19, 2016 · 6 comments

Projects

None yet

3 participants

@rpoelking

When running the plugins on startup, only Australia shows up as a country; where are the rest? I need United States!

@benkeen
Owner
benkeen commented May 19, 2016

Wait, so you're saying Australia isn't the only country of significance in the world? Surely not. ;)

Hmm... haven't heard of this issue before, but it's conceivable it's a bug. Couple of things:

  • check your /plugins/countries folder and confirm there's a whole lot of subfolders for each country.
  • could you paste a screenshot of the page?

Also, can you complete the installation? I'm curious to see if the page actually works or not. I suspect not, so it would be interesting to see.

@rpoelking

Well, as much as I admire Australia.... ;)

So, yes, the plugins countries folder is loaded with several countries.
The install did in fact complete but I did not actually generate anything yet.

What page did you want a screenshot of?

@mansoorjamal
mansoorjamal commented May 22, 2016 edited

Coincidently, I just ran into a similar issue, though the only country I can see is Germany.

I've attached screenshots to help diagnose the issue, including directory structure. They show the install steps showing only Germany, and the inability to select any other country after a successful deploy.

I have tried both the zip and tar files, as well as both with single user and no auth user (with proper cleanup including fully dropped and recreated mysql db).

I'd be happy to run any test for you, including file modifications and debugging.

Thanks for your help benkeen!
install_success
germany_drop_only
only_germany

no_canada
dir_structure

@mansoorjamal

Ok, I think I have fixed the issue.

The easiest way to fix the problem is to remove, from plugins/countries, the following directories:

Turkey, Austria, Chile and China.

Countries will then show up properly. The one country showing up problem is actually dependent on the order your OS parses the countries the dir open call. The first one, if well parsed, is the one that shows up.

I think this has something to do with instantiateCountryPlugin returning false on errors (or elsewhere some other issue) - I did not have time to debug this part in detail.

Regardless, the underlying parse problem comes from the use of the field regionShort. In the region table, it is defined as char(3). However, for Turkey, Austria and Chile, the class file that defines the country and its regions uses regionShort values that are bigger than three characters.

This causes problems.

You can can either edit the class files manually and change regionShort values to be 3 character or less (wherever they are more than three characters in Turkey.class.php, Chile.class.php and Austria.class.php) or simply overwrite them with the attached ones in the countries_class.zip file to fix the issue.

Note that the China class file is ok, so to speak. It is fully commented out for now by the author, which is why China is not showing up in the list.

Regards,

Mansoor

country_class.zip

@mansoorjamal

@benkeen If you give me checkin access to the repository, I'd be happy to check in the fix myself.

Thanks.

@benkeen
Owner
benkeen commented May 24, 2016

Hey @mansoorjamal - thanks for posting the fix! And sorry for not responding earlier - it's been a hectic few days.

Yeah, I'd love to get a fix: for that just put in a PR and I'll merge in it.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment