Page MenuHomePhabricator

Regression in tablesorting (jquery.tablesorter.js)
Closed, ResolvedPublic

Description

Author: accnospamtom

Description:
Starting with -r86088 MW uses a "completely rewritten table sorting script" (/resources/jquery/jquery.tablesorter.js)

This doesn't behave like before, when using a date format like dd.mm.yyyy (quite common in german).

Example:

{| class="sortable"

-

! Date

-
11.11.2011
-
01.11.2011
-
02.10.2011
-
03.08.2011
-
09.11.2011
}

used to work in MW before, but isn't sorted correct now. It results in

01.11.2011
02.10.2011
03.08.2011
09.11.2011
11.11.2011

For backwards compatibility this should be fixed. Sorry for my poor english ;)


Version: 1.18.x
Severity: normal

Details

Reference
bz28775

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:31 PM
bzimport set Reference to bz28775.

We should add test cases for this sort of regression; should be possible to do these with the qunit system.

See under tests/qunit/jquery & the info at http://www.mediawiki.org/wiki/Manual:JavaScript_unit_testing

Basic test structure should go something like this:

  • create an HTML table with known structure
  • apply the table sorter setup on it
  • trigger the table sort for a particular column
  • iterate over the table to confirm it sorted correctly
    • report success/errors
  • remove table & return

Test cases for this bug added in r90619.