Page MenuHomePhabricator

Statistics module uses country field instead of lang field to link to Wikipedia
Closed, ResolvedPublic

Description

This list has incorrect links to Ukrainian wikipedia https://tools.wmflabs.org/heritage/api/api.php?action=statistics&stcountry=ua&format=html&limit=10

Country code is ua, but language code is uk
correct link should start with http://uk.wikipedia.org, not http://ua.wikipedia.org


Version: unspecified
Severity: normal
URL: https://tools.wmflabs.org/heritage/api/api.php?action=statistics&stcountry=ua&format=html&limit=10

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:45 AM
bzimport set Reference to bz53688.
bzimport added a subscriber: Unknown Object (MLST).

The database is incorrect, see http://toolserver.org/~erfgoed/api/api.php?action=search&format=json&srcountry=ua

The problem is that the statistics module uses the country field instead of the language field to link to Wikipedia. I thought we had a bug open for that, but I can't find it. Updating this bug.

I don't have a clue where to fix this. Added Nuno, maybe he can help.

Aklapper lowered the priority of this task from High to Medium.Dec 29 2014, 12:34 AM
Aklapper subscribed.

No updates for more than a year - decreasing priority. Feel free to increase again if someone plans to work on this.

Can verify that this is still an open bug.

No clue exactly where country and lang are being mixed up but it could possibly be over in /api/includes/Staistics.php:84

Can verify that this is still an open bug.

No clue exactly where country and lang are being mixed up but it could possibly be over in /api/includes/Staistics.php:84

While this pinpoints where the mixup is happening the source of the problem is that the statistics table simply does not keep track of the language (or the project). Instead it uses idx which is simply <country>:<municipality> without even removing wikisyntax from municipality.

If we want to fix this we would have to restructure how the statistics?? table is set up (or at least how idx` is set) in StatsBuilder::getFieldStats. Then hunt down anywhere where this is affected.

That said is anyone using the statistics tool and is it worth supporting? @JeanFred @Multichill
The same question applies to the statisticsct / ContestStatistics.

Change 289314 had a related patch set uploaded (by Lokal Profil):
Add lang and project to statistic reports

https://gerrit.wikimedia.org/r/289314

Changing tags since this is an api issue not a db issue

Change 289314 merged by jenkins-bot:
Add lang and project to statistic reports

https://gerrit.wikimedia.org/r/289314

Change 289427 had a related patch set uploaded (by Lokal Profil):
Re-add wikitext in statistics id

https://gerrit.wikimedia.org/r/289427

@JeanFred: Would you mind taking another look at the patch-set? I pushed an update at the same time as you +2'd so nothing got merged.

Change 289427 merged by jenkins-bot:
Re-add wikitext in statistics id

https://gerrit.wikimedia.org/r/289427

Mentioned in SAL [2016-05-23T12:50:40Z] <Lokal_Profil> Deployed latest from Git, 50915bf (T55688)