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

Failure to render in last release #207

Open
Nerian opened this issue Jul 7, 2022 · 9 comments
Open

Failure to render in last release #207

Nerian opened this issue Jul 7, 2022 · 9 comments

Comments

@Nerian
Copy link

Nerian commented Jul 7, 2022

Hi,

Using country_select (8.0.0)

I believe something changed with the latest release because I get an error.

Screenshot 2022-07-07 at 10 25 11

f.input :country, include_blank: false

I believe this happens because if this change: 981cd24#diff-b3e24e44f4100d7ed00cce762b96b5459e6db4c269a3ed31f25c71d8fbade460R102

Notice that in the country list there is

 [nil, "Netherlands antilles"], [nil, "Cote divoire"]]

and that first value is what gets passed to the I18n.transliterate(name), name]. But because 'name' is null it raises.

I had to add this in order to fix it for the time being.

CountrySelect::DEFAULTS[:except] = ['NETHERLANDS ANTILLES', 'COTE DIVOIRE']
@afdev82
Copy link

afdev82 commented Jul 19, 2022

I have this error too! Any news about that?

@henrik
Copy link
Contributor

henrik commented Jul 29, 2022

FWIW it works fine here – country_select renders with "Netherlands Antilles".

Looks odd that your country_codes in the screenshot includes "NETHERLANDS ANTILLES" instead of its country code (AN). Out of curiosity, does this work for you in a console?

>> ISO3166::Country.search("AN")
=> #<ISO3166::Country:0x0000558171c49558 @country_data_or_code="AN", @data={"translations"=>{"sv"=>"Nederländska Antillerna", "en"=>"Netherlands Antilles", "de"=>"Niederländische Antillen", "es"=>"Antillas Neerlandesas"}, "alpha2"=>"AN"}>

@Nerian
Copy link
Author

Nerian commented Jul 29, 2022

[1] pry(main)> ISO3166::Country.search("AN")
=> nil
countries (5.1.1)
country_select (8.0.0)

@henrik
Copy link
Contributor

henrik commented Jul 29, 2022

Ah, I'm on countries 5.0.0 and country_select 8.0.0.

@olleolleolle
Copy link
Contributor

olleolleolle commented Aug 2, 2022

DEV 15:29:24 >> ISO3166::Country.search("AN")
=> #<ISO3166::Country:0x00005620073169d8
 @country_data_or_code="AN",
 @data=
  {"translations"=>
    {"sv"=>"Nederländska Antillerna",
     "en"=>"Netherlands Antilles",
     "de"=>"Niederländische Antillen",
     "es"=>"Antillas Neerlandesas"},
   "alpha2"=>"AN"}>

Looks good to me, I'm on countries 5.1.1 and country_select 8.0.0.

@Nerian
Copy link
Author

Nerian commented Aug 12, 2022

@olleolleolle Are you sure you were running countries 5.1.1? Did you bundle exec rails c?

I still get nil even with countries 5.1.2

[3] pry(main)> ISO3166::Country.search("AN")
=> nil

@pmor
Copy link
Member

pmor commented Jan 26, 2023

Netherlands Antilles was dissolved in 2010 and is no longer a constituent country of the Netherlands, having been split into Bonaire, Saint Eustatius and Saba (BQ), Curaçao (CW) and Sint Maarten (SX), so ISO3166::Country.search("AN") should be nil.

As far as I can tell, the AN code was removed from the underlying countries gem in 2016, and 'COTE DIVOIRE' is mis-spelled, so I'm a bit puzzled with where that list of countries comes from.

@zerobearing2
Copy link
Contributor

Was having same error after upgrading to Rails 7.1 today, #222 seems to fix it.

@olleolleolle
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants