Last modified: 2009-02-02 16:41:38 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 T19105, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17105 - Numeric table sorting broken
Numeric table sorting broken
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://en.wikipedia.org/wiki/List_of_...
: patch
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-21 19:05 UTC by bluehairedlawyer
Modified: 2009-02-02 16:41 UTC (History)
1 user (show)

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


Attachments
fix numeric sorting (366 bytes, patch)
2009-01-21 19:06 UTC, bluehairedlawyer
Details

Description bluehairedlawyer 2009-01-21 19:05:19 UTC
A column which should sort numerically but which contains even one non-numeric element will not sort correctly or will produce strange results. It seems to sort numerically but leaves lots of numbers out of place at the bottom of the table.

This appears to be caused by recent diff:

r1=42576&r2=42715">http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/skins/common/wikibits.js?r1=42576&r2=42715

which allows ts_parseFloat to return a non-numeric value. This is rather pointless as the return value isn't see by anything other than javascript's table.sort() which doesn't appear to like it very much. Although browsers could handle this better, it affects (as far as I can see) Firefox and Safari. 

For a (clearer) example see:
http://en.wikipedia.org/wiki/User:Blue-Haired_Lawyer/sandbox2
Comment 1 bluehairedlawyer 2009-01-21 19:06:27 UTC
Created attachment 5716 [details]
fix numeric sorting
Comment 2 bluehairedlawyer 2009-01-25 11:43:26 UTC
Ideally non-numeric entries in numeric lists (for example unranked entries in GDP lists) should sort to the end of the list regardless of the way the list is being sorted.
Comment 3 bluehairedlawyer 2009-01-25 11:46:03 UTC
This really needs to be fixed. I've increased the priority.
Comment 4 Siebrand Mazeland 2009-02-02 16:41:38 UTC
Applied in r46716. Thanks.

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


Navigation
Links