Add data-sort-value for better sorting on Special:Tags
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 21 Aug 2013 15:40:06 +0000 (17:40 +0200)
committerMatmaRex <matma.rex@gmail.com>
Sat, 24 Aug 2013 16:51:28 +0000 (18:51 +0200)
Due to the word "change" within the cell of the hitcounters, the
tablesorter does not detect a number type. Adding the raw hitcounter as
sort-value lets the tablesorter choose the number sorting.

Bug: 51742
Change-Id: I6704e73fdd1f5c2744e18251d8b9ef0f68938841

RELEASE-NOTES-1.22
includes/specials/SpecialTags.php

index ab08972..239d997 100644 (file)
@@ -269,6 +269,7 @@ production.
 * (bug 39012) File types with a mime that we do not know the extension for
   can no longer be uploaded as an extension that we do know the mime type
   for.
+* (bug 51742) Add data-sort-value for better sorting of hitcounts Special:Tags
 
 === API changes in 1.22 ===
 * (bug 25553) The JSON output formatter now leaves forward slashes unescaped
index b19c6e8..6a282c9 100644 (file)
@@ -89,9 +89,10 @@ class SpecialTags extends SpecialPage {
                }
                $newRow .= Xml::tags( 'td', null, $desc );
 
-               $hitcount = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped();
-               $hitcount = Linker::link( SpecialPage::getTitleFor( 'Recentchanges' ), $hitcount, array(), array( 'tagfilter' => $tag ) );
-               $newRow .= Xml::tags( 'td', null, $hitcount );
+               $hitcountLabel = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped();
+               $hitcountLink = Linker::link( SpecialPage::getTitleFor( 'Recentchanges' ), $hitcountLabel, array(), array( 'tagfilter' => $tag ) );
+               // add raw $hitcount for sorting, because tags-hitcount contains numbers and letters
+               $newRow .= Xml::tags( 'td', array( 'data-sort-value' => $hitcount ), $hitcountLink );
 
                $doneTags[] = $tag;