Last modified: 2011-03-13 18:04:41 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 13614 - Special:Whatlinkshere display could be sorted
Special:Whatlinkshere display could be sorted
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
  Show dependency treegraph
Reported: 2008-04-04 15:42 UTC by Nicolas Dumazet
Modified: 2011-03-13 18:04 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

proposed patch (606 bytes, patch)
2008-04-04 15:42 UTC, Nicolas Dumazet

Description Nicolas Dumazet 2008-04-04 15:42:53 UTC
Created attachment 4785 [details]
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 :)
Comment 1 Brion Vibber 2008-04-04 17:44:36 UTC
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.
Comment 2 Chad H. 2008-04-10 18:41:44 UTC
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.
Comment 3 Aaron Schulz 2008-05-27 04:53:36 UTC
Sorting by page_id looks fine here. Note there are also filters to only get certain inclusion/link types.

Note You need to log in before you can comment on or make changes to this bug.