Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserCountryMap plugin shows wrong options in countries select #8285

Closed
parruc opened this issue Jul 7, 2015 · 2 comments
Closed

UserCountryMap plugin shows wrong options in countries select #8285

parruc opened this issue Jul 7, 2015 · 2 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@parruc
Copy link
Contributor

parruc commented Jul 7, 2015

In country select I found a non-working option

<select class="userCountryMapSelectCountry">
...
<option value="undefined">European Union</option>
...
</select>

To avoid this I patched visitor-map.js adding the if that excludes undefined isos

                        // populate country select
                        $.each(countryData, function (i, country) {
                            if ( country.iso )
                                countrySelect.append('<option value="' + country.iso + '">' + country.name + '</option>');
                        });

                        initUserInterface();
@mattab
Copy link
Member

mattab commented Jul 15, 2015

Hi @parruc

Thanks for the report.

I can't find "European union" in maps country selector on demo.piwik.org - but there are other "undefined" countries. Here is the full list

<select>
[...]
<option value="undefined">Anonymous Proxy</option>
[...]
<option value="undefined">Satellite Provider</option>
[...]
<option value="undefined">Unknown</option>
<option value="undefined">Unknown</option>
<option value="undefined">Unknown</option>
[...]
</select>

The goal of this issue is to remove "undefined" entries from the Map selector.

@mattab mattab added Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. Bug For errors / faults / flaws / inconsistencies etc. labels Jul 15, 2015
@mattab mattab added this to the 2.14.1 milestone Jul 15, 2015
@mattab mattab changed the title UserCountryMap plugin shows wrong option in countries select UserCountryMap plugin shows wrong options in countries select Jul 16, 2015
@parruc
Copy link
Contributor Author

parruc commented Jul 16, 2015

A temporary patch would be the one I wrote on the first post adding:

if ( country.iso )

works for me.

I did not open a pull request because It looks like a dirt solution but if you approve I'll open it.

@mattab mattab modified the milestones: 2.14.1, 2.15.0 Jul 16, 2015
@barbushin barbushin assigned barbushin and unassigned barbushin Jul 22, 2015
@mnapoli mnapoli self-assigned this Jul 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

No branches or pull requests

4 participants