Page MenuHomePhabricator

Still seeing new invalid made up locale saved to contact preferred_language
Closed, ResolvedPublic

Description

"However, historically our code just added together the language string 'en' and the country string 'DK' to get 'en_DK' - since that wasn't in the database it was just added.

Later we made it so that it would not add new languages but rather come up with a realistic fallback - ie 'en_US' since that is the language we actually send emails in."
Based on the ticket https://phabricator.wikimedia.org/T321251 we seems no longer add the new invalid made up locale, while when we are getting the en_xx cleaned up, we are stilling seeing a lot new invalid locales coming up
MariaDB [civicrm]> select is_deleted, count(*) FROM civicrm_contact WHERE preferred_language like "en_%" and preferred_language not in ('en_US', 'en_AU', 'en_ZA', 'en_GB', 'en_CA') group by is_deleted;

is_deletedcount(*)
09071
1520711

2 rows in set (43.845 sec)
need to find out where are those coming from and then unblock the T321251, otherwise those five character locale data could never get cleaned up.

Event Timeline

Need to have https://gerrit.wikimedia.org/r/c/wikimedia/fundraising/crm/+/856688/ this merge to production, and then manually run the drush @wmff cvapi WMFDataManagement.CleanInvalidLanguageOptions version=4 to see it the old one still coming back

\Civi\Api4\Action\WMFContact\Save::getPreferredLanguage from this file we can see if we have no matched language from civicrm_option_value table, then we use en_US so when we have one language cleaned up, should go to civi and run drush @wmff cvapi WMFDataManagement.CleanInvalidLanguageOptions version=4 to get the unused one clean from it, and this will fix this problem, so move this time to close.

greg subscribed.

(just reopening so we can review during sprint review)

XenoRyet set Final Story Points to 0.