The function with country codes definition for the clickatell module, has redundant items. If this happen shows the last item name on the first match.
For example,
34 => "Canary Islands" (a province of Spain)
and later
34 => "Spain"
so in the selection country list, Spain is in the alphabetic position of Canary Islands (the last place where I will look for Spain it would be in the C letter)
The same happen with:
252 Tanzania/Zanzibar
The best solution for the first case is delete the Canary Islands because is already into the Spain selection.
In the second one, in the same way that it was already done with other matches, is to group different countries together.
Comments
Comment #1
Will White commentedOne way to deal with this and add more flexibility at the same time would be to create a CRUD interface for adding and editing countries. This would allow admins to disable countries as needed. This feature would replace the current array system and would resolve this issue. What do you think about that plan?
Comment #2
jcmarco commentedIt could allow also to add a phone number length field for each defined country and also the option to have only a default country that avoid the country selection dropdown.
Comment #3
jose reyero commentedI think the list shouldn't be indexed by ISO country code, which are unique and well defined. Then we do the mapping on the server to get the dial code.
An outstanding case may be also US and Canada, both using the +1 code.
We can reuse country lists from 'location' or other modules.
Comment #4
Will White commentedWill be fixed with #331629: Develop module that handles international number validation.