Hi,

I've tried to enable Countries having a language other than English (Portuguese) as defauld and I got the following error:

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Listenstaine' for key 3: INSERT INTO {countries_country} (iso2, iso3, name, official_name, continent, enabled, numcode) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5,
...
:db_insert_placeholder_1740, :db_insert_placeholder_1741, :db_insert_placeholder_1742); Array ( [:db_insert_placeholder_0] => AF [:db_insert_placeholder_1] => AFG [:db_insert_placeholder_2] => Afeganistão [:db_insert_placeholder_3] => Islamic Republic of Afghanistan
...
[:db_insert_placeholder_1733] => NA [:db_insert_placeholder_1734] => 1 [:db_insert_placeholder_1735] => 534 [:db_insert_placeholder_1736] => BQ [:db_insert_placeholder_1737] => BES [:db_insert_placeholder_1738] => Bonaire, Saint Eustatius and Saba [:db_insert_placeholder_1739] => Bonaire, Saint Eustatius and Saba [:db_insert_placeholder_1740] => NA [:db_insert_placeholder_1741] => 1 [:db_insert_placeholder_1742] => 535 ) em countries_import_csv() (linha 146 de ... modules/countries/countries.install).

I've set the default language to English and the error was no longer displayed.

Comments

alan d.’s picture

Status: Active » Postponed (maintainer needs more info)

I18n is on the TODO list, but I haven't found any doco for this yet.

Two possible reasons:

1) As per the issue at hand, the install script should only run once. Was there any other errors that you saw? Either during installation or uninstallation?

2) Can you check that the translations for Portuguese do not contain two country translations that translate to "Listenstaine". This would also cause this error, and would be an issue with these and not the code (although the code could be made more robust to handle these....)

alan d.’s picture

Status: Postponed (maintainer needs more info) » Fixed

No feedback, so I'm closing this issue.

I am fairly certain that this is a GIGO issue, with duplicate translations for two countries being the same. If more translation sets have issues, please reopen and I'll add additional checks into the module.

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.