Page MenuHomePhabricator

API query siteinfo namespacealiases should be sorted numerically, not by source
Closed, ResolvedPublic

Description

Currently, the namespace aliases seems to be sourced by the configuration source and not by numeric ascending order.

It would look nicer and more coherent if we could offer a numeric order there too.


Version: 1.21.x
Severity: enhancement
URL: http://hu.wiktionary.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases

Details

Reference
bz45382

Event Timeline

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

It is possible, that one namespace has more than one alias, than sorting by number has not a very well numeric order.

See dewiki:
http://de.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces|namespacealiases

You can sort on the client, if needed, or must this done on server side?

sumanah wrote:

Brad Jorsch tells me this is reasonably easy and should just need a sort with an appropriate custom sort function in appendNamespaceAliases() in
includes/api/ApiQuerySiteinfo.php.

Change 74618 had a related patch set uploaded by Fantasticfears:
add a anonymous function in appendNamespaceAliases for pretty output

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

Change 74618 abandoned by Fantasticfears:
add a anonymous function in appendNamespaceAliases for pretty output

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

Change 79173 had a related patch set uploaded by Fantasticfears:
add a anonymous function in appendNamespaceAliases for pretty output

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

Change 79173 merged by jenkins-bot:
Sort namespace aliases by id in appendNamespaceAliases for pretty output

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

The change should be deployed to WMF wikis with 1.22wmf15.