Page MenuHomePhabricator

Inappropriate ordering of list=alldeletedrevisions results
Closed, DeclinedPublic

Description

This query has results ordered by (ns_num, title) in descending order, which is hardly an appropriate default ordering (e.g., pages from the main namespace come last).

The documentation for list=alldeletedrevisions says:

adrdir:
In which direction to enumerate:

  • newer:

List oldest first. Note: adrstart has to be before adrend.

  • older:

List newest first (default). Note: adrstart has to be later than adrend.

That is the timestamp-based ordering, but in practice that happens if and only if the adruser parameter is supplied -- if it is not supplied, the ordering is not timestamp-based but title-based.

Event Timeline

Anomie subscribed.

The documentation of all modules' sorting parameters could be improved, but the actual ordering of the results can't be changed without changing the indexes in the database.

Changing the direction of the sorting does not require changing the indexes so you could at least swap the direction for the default title-based ordering.

Also, this is one of the few (if not the only one) modules where both title-based and timestamp-based sorting are hidden behind a single "newer"/"older" pair, which makes sense only for the latter. Ideally, that should be improved as well. What's wrong with SQL's "asc"/"desc" anyway?

Direction of the sorting is controlled by the adrdir parameter. We can't sanely have that default to different things based on other parameters.

Every module I'm aware of uses the same parameter for determining the sorting direction. Some use "ascending" and "descending" instead. list=allimages has both sets, and list=categorymembers has both sets plus "asc" and "desc".