Last modified: 2013-10-23 16:58:53 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 T58038, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56038 - [Regression] Tablesorter broken for abbreviated months
[Regression] Tablesorter broken for abbreviated months
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.22.0
All All
: High normal (vote)
: 1.22.0 release
Assigned To: Bartosz Dziewoński
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 09:23 UTC by Michael M.
Modified: 2013-10-23 16:58 UTC (History)
3 users (show)

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


Attachments

Description Michael M. 2013-10-23 09:23:53 UTC
The script for sortable tables is broken if a date contains an abbreviated month, see the example (tested on de.wikipedia)

{|class="wikitable sortable"
! data-sort-type="date" | date1 !! data-sort-type="date" | date2
|-
| 1. Jan.2012 || 1. Jan. 2012
|-
| 1. Apr.2011 || 1. Apr. 2011
|}

The first column sorts randomly, only the second one is correct. I tracked this down to

> jQuery.tablesorter.dateRegex[1]
< /^\s*(\d{1,2})[\,\.\-\/'\s]+(januar|januars|jan\.|februar|februars|feb\.|märz|märzes|mär\.|april|aprils|apr\.|mai|mais|mai|juni|junis|jun\.|juli|julis|jul\.|august|augusts|aug\.|september|septembers|sep\.|oktober|oktobers|okt\.|november|novembers|nov\.|dezember|dezembers|dez\.)[\,\.\-\/'\s]+(\d{2,4})\s*$/i

Note the \. after the abbreviations, which shouldn't be there (otherwise the expected separator to the year is missing).

https://git.wikimedia.org/blob/mediawiki%2Fcore.git/5bf45af50e6049ded2915f360fb1ed914f839286/resources%2Fjquery%2Fjquery.tablesorter.js#L484

is supposed to remove it, but it does so for the wrong month forms, namely for the genitives instead of the abbrevs.
Comment 1 Bartosz Dziewoński 2013-10-23 09:57:54 UTC
Whooooops. It seems like I broke it in If758499f when adding support for genitive-form month names. Sorry about that, I'll submit a patch in a minute.
Comment 2 Gerrit Notification Bot 2013-10-23 10:00:32 UTC
Change 91363 had a related patch set uploaded by Bartosz Dziewoński:
tablesorter: Unbreak abbreviated month name support

https://gerrit.wikimedia.org/r/91363
Comment 3 Gerrit Notification Bot 2013-10-23 15:54:18 UTC
Change 91363 merged by jenkins-bot:
tablesorter: Unbreak abbreviated month name support

https://gerrit.wikimedia.org/r/91363
Comment 4 Bartosz Dziewoński 2013-10-23 16:58:53 UTC
Fixed and merged. Thank you for the report!

It will be deployed to Wikipedias on 31 October
per [[mw:MediaWiki 1.23/Roadmap]] (I think, we're
releasing 1.23 and I'm not quite sure which version
is which now).

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


Navigation
Links