Last modified: 2009-07-19 19:32:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14644, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12644 - Template links on article preview page should be in alphanumeric (alphabetic) order
Template links on article preview page should be in alphanumeric (alphabetic)...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.12.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy, patch, patch-need-review
: 19426 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-15 19:15 UTC by Greg Ebdon
Modified: 2009-07-19 19:32 UTC (History)
3 users (show)

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


Attachments
Patch to Linker.php as of r30183 (380 bytes, patch)
2008-01-27 16:26 UTC, Chad H.
Details

Description Greg Ebdon 2008-01-15 19:15:22 UTC
See also bug 12532, and bug 12532, comment 4.

Basically, it would be very useful if the links to all the templates used in a page could be sorted in alphanumeric order for ease of finding a particular one. Obviously they're all in the same namespace, so just the BASEPAGENAME needs to be sorted. IIRC, they're currently in a random order - it might also be possible to have either a small link or an option in preferences to put them in the order they're used in the page.
Comment 1 Christian Neubauer 2008-01-15 21:45:39 UTC
They aren't necessarily in the same namespace.  You can transclude a page from any namespace and it'll show up in the template list.
Comment 2 Greg Ebdon 2008-01-16 18:51:47 UTC
(In reply to comment #1)
> They aren't necessarily in the same namespace.  You can transclude a page from
> any namespace and it'll show up in the template list.
> 

This is true... I hadn't thought of that. Another I was planning to ask was if a feature could be implemented to link to substed templates on a preview page as well (e.g. if you've added a template in your current edit, you have to remove the subst: to get it to show up in the list, then replace it when saving. You think that might be useful?
Comment 3 Chad H. 2008-01-27 16:26:18 UTC
Created attachment 4590 [details]
Patch to Linker.php as of r30183

I'm not sure if this works. It seems almost /too/ easy. Can someone more
familiar with this part of the code take a look? Thanks.
Comment 4 Greg Ebdon 2008-05-04 10:21:46 UTC
(In reply to comment #3)
> Created an attachment (id=4590) [details]
> Patch to Linker.php as of r30183
> 
> I'm not sure if this works. It seems almost /too/ easy. Can someone more
> familiar with this part of the code take a look? Thanks.
> 

Whether with ^demon's patch or not, this feature seems to have been implemented - look at a few multi-template articles to confirm. Can someone confirm this code-wise and mark the bug resolved, please?
Comment 5 Brion Vibber 2008-05-07 01:56:04 UTC
They'll be sorted on initial view because they're pulled from the database in indexed order; but on preview, they'll appear in the order of parsing.
Comment 6 Brion Vibber 2008-05-08 23:17:48 UTC
(The previously attached patch doesn't work for two reasons: sort() doesn't return a value, breaking the array, and the sorting doesn't handle the title objects correctly.)

Fixed in r34485.

On initial edit, items were sorted by virtue of being pulled from a sorted table, but on preview they were displayed in rough order of use in parsing, which is a bit less legible.

Added Title::compare() static comparator available as a callback for usort(), using it in Linker::formatTemplates().
Comment 7 Brion Vibber 2009-07-19 19:32:25 UTC
*** Bug 19426 has been marked as a duplicate of this bug. ***

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


Navigation
Links