Page MenuHomePhabricator

Special:Whatlinkshere display could be sorted
Closed, DeclinedPublic

Description

Author: nicdumz

Description:
proposed patch

The actual displayed list of Special:Whatlinkshere is a bit messy, since pages are being sorted by page_id.

With the current DB structure, it seems to me that it would be costly to alter the SQL queries to sort the results in any way.

This patch performs a manual usort() on the resulting set, after it has been truncated to $limit (the number of pages to show).

It does not alter which pages are being shown on each page : It only alters the sorting display on a per page basis. Namespace first, template transclusion second : The page is now sorted by namespace, and pages where the target page is trancluded come last.

Cheers :)


Version: 1.13.x
Severity: enhancement

Attached:

Details

Reference
bz13614

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:04 PM
bzimport set Reference to bz13614.
bzimport added a subscriber: Unknown Object (MLST).

Well, the problem here is that there's still no ordering from page to page; sorting within the page would imply a sensible overall ordering which doesn't exist.

Further up the page, the array is ksort()'d. What if after that was done, a normal sort ( $rows , SORT_STRING) was run to order the list before outputting it. I might be way off the mark here though.

Sorting by page_id looks fine here. Note there are also filters to only get certain inclusion/link types.