Page MenuHomePhabricator

Cleanup invalid languages
Open, NormalPublic

Description

On commons...P5879 there are a lot of fscked language properties

select up_value, count(up_value) as cnt from user_properties where up_property = 'language' group by up_value order by cnt DESC;

Interesting rows that I've nuked on commons

mysql:wikiadmin@db1068 [commonswiki]> DELETE FROM user_properties WHERE up_property = 'language' AND up_value LIKE '%ownwork';
Query OK, 9473 rows affected (1 min 34.18 sec)

mysql:wikiadmin@db1068 [commonswiki]> DELETE FROM user_properties WHERE up_property = 'language' AND up_value LIKE '%fromgov';
Query OK, 141 rows affected (2.69 sec)

mysql:wikiadmin@db1068 [commonswiki]> DELETE FROM user_properties WHERE up_property = 'language' AND up_value LIKE '%fromwikimedia';
Query OK, 416 rows affected (2.58 sec)

mysql:wikiadmin@db1068 [commonswiki]> DELETE FROM user_properties WHERE up_property = 'language' AND up_value LIKE '%fromflickr';
Query OK, 439 rows affected (2.34 sec)

In https://gerrit.wikimedia.org/r/#/c/367781/ maintenance/cleanupPreferences.php we should add something like...

'DELETE FROM user_properties WHERE up_property = 'language' AND up_value NOT IN (' . implode( ' ,', Language::fetchLanguageNames() ) . ');'

Event Timeline

Reedy created this task.Aug 12 2017, 4:05 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 12 2017, 4:05 PM
Reedy updated the task description. (Show Details)Aug 12 2017, 4:08 PM
Reedy updated the task description. (Show Details)Aug 12 2017, 4:23 PM

IIRC those commons languages were hacks using {{int:}} and stuff

Jdforrester-WMF added a subscriber: Jdforrester-WMF.