Last modified: 2012-02-14 17:35:09 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 T33137, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31137 - Table sorter should support mixed strings and numbers in one column
Table sorter should support mixed strings and numbers in one column
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.17.x
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks: 31601
  Show dependency treegraph
 
Reported: 2011-09-24 16:00 UTC by reza1615
Modified: 2012-02-14 17:35 UTC (History)
4 users (show)

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


Attachments

Description reza1615 2011-09-24 16:00:43 UTC
If table has string and integer in one column.media wiki has problem with sorting.
specially up to down sorting 
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/table_bug
Comment 1 reza1615 2011-09-24 16:04:45 UTC
In English table it has 4 type sorting 2 types string sorting and others are integer sorting but in Persian table it has only 2 type and that is string sorting
Comment 2 Mark A. Hershberger 2011-09-24 18:08:41 UTC
Krinkle (Since I think you did the sorting code), is this something that would have to be done upstream or could we add it?
Comment 3 Derk-Jan Hartman 2011-09-25 16:42:18 UTC
The bug is on 1.17wmf1. The upcoming 1.18 has totally different sorting code that should fix this, by giving the user the option to define how the column should be sorted.
Comment 4 reza1615 2011-09-25 16:55:42 UTC
is it possible to save sorted table as new table?
Comment 5 Krinkle 2011-09-25 23:23:49 UTC
 Marking INVALID as 1.18 has a new sorting system which supports this.

(In reply to comment #4)
> is it possible to save sorted table as new table?
No, but that's not related to this bug. Please ask on IRC or at the support desk: http://www.mediawiki.org/wiki/Support
Comment 6 reza1615 2011-10-07 11:26:45 UTC
now (1.18) it completely disabled!
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/table_bug
Comment 7 Derk-Jan Hartman 2011-10-07 12:14:42 UTC
@reza1615  Your tables don't use headers, and headers are required to add sorting. If it worked like that before 1.18, than we fixed a big bug in my opinion.

See also:
https://meta.wikimedia.org/wiki/Help:Table#Sorting
Comment 8 reza1615 2011-10-07 12:40:48 UTC
I added header but it doesn't work correctly
http://fa.wikipedia.org/wiki/%DA%A9%D8%A7%D8%B1%D8%A8%D8%B1:Reza1615/table_bug
in both  English and Farsi numbers the biggest number (102) is not sorted as biggest one.
Comment 9 Derk-Jan Hartman 2011-10-07 13:46:50 UTC
That's because you are using it wrong. When you mix types, you need to tell it what type to use for sorting. 

See https://meta.wikimedia.org/wiki/Help:Sorting#Sort_modes
Comment 10 Derk-Jan Hartman 2011-10-07 13:51:02 UTC
Oh, and for defining an order that is not yet predefined, you have to define your own collation algorithm: https://meta.wikimedia.org/wiki/Help:Sorting#Text  That will solve the issue of your farsi numbers ordering.

You might have to do this in MediaWiki:Common.js if you want it to work for all users.
Comment 11 reza1615 2011-10-07 14:57:33 UTC
i set like
mw.config.set('tableSorterCollation', {'۰':'0', '۱' : '1', '۲': '2', '۳':'3','۴':'4', '۵' : '5', '۶': '6', '۷':'7','۸':'8', '۹' : '9'});
but in mix table it doesn't recognize ۱ as number and ۲ (2 in English) is upper than ۱۱۱ (111 in English)
also i tested it in meta
https://meta.wikimedia.org/wiki/User:Reza1615/test
it is the same as fa.wiki
Comment 13 reza1615 2012-02-14 17:35:09 UTC
it is solved 
thank you from who solved it :)

http://winkyfrown.com/fawiki/index.php/Table

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


Navigation
Links