Item6031: TablePlugin date sorting is broken.

Priority: Urgent
Current State: Closed
Released In:
Target Release: patch
Applies To: Extension
Component: TablePlugin
Reported By: TWiki:Main.MartinCleaver
Waiting For:
Last Change By: KwangErnLiew
Title Date Size Span date
ABC 26 May 2007 - 22:36 5.6 K 26 May 2007 - 22:36
DEF 07 Feb 2006 - 13:23 0.2 K 07 Feb 2006 - 13:23
GHI 26 Jul 2007 - 13:23 0.2 K 26 Jul 2007 - 13:23
JKL 16 Sep 2008 - 09:48 10.2 K 16 Sep 2008 - 09:48
MNO 06 Feb 2006 - 19:02 3.4 K 06 Feb 2006 - 19:02

This should sort by date. Instead it sorts alphabetically, so May 2007 is listed after July 2007.

http://twiki.org/cgi-bin/view/Support/TableSortingbyDateDoesntWork

-- TWiki:Main/MartinCleaver - 30 Sep 2008

? I can't see the problem in the table above. Maybe I need new glasses or am getting old.

-- TWiki:Main.FranzJosefGigler - 30 Sep 2008

The attachment table is wrong: http://twiki.org/cgi-bin/view/Sandbox/AttachmentTest?sortcol=4;table=1;up=1#sorted_table

-- TWiki:Main.ArthurClemens - 30 Sep 2008

http://twiki.org/cgi-bin/view/Sandbox/AttachmentTest?sortcol=3;table=1;up=0#sorted_table As you can see, it's not only tables, but sizes also are bugged.

Updating the table above to ensure it works if not in an Attachment.

  • In fact, it's normal that it doesn't work like this for sizes, but imho, it should for the attachment table

Ok, Attachment tables generate some span tag to avoid wrapping, which is not caught by the code which transforms dates into values:
 <span class="twikiNoBreak">26 May 2007 - 22:36</span>
-- TWiki:Main.OlivierRaginel - 30 Sep 2008

Probably the sorting code does not strip out the html tags.

Confirmed: removing <span class"twikiNoBreak"></span> from attachtables.tmpl fixes the sorting.

The problem is that the column is defined as text, not a date column. So the html is being stripped out, but it is too late.

Working on it now.

-- TWiki:Main.ArthurClemens - 30 Sep 2008

Fixed. Free as in beer.

-- TWiki:Main.ArthurClemens - 30 Sep 2008

Awesome smile Thanks.

-- TWiki:Main.MartinCleaver - 30 Sep 2008

I'm reopening this, cause TWikirev:17547 makes trunk to die if there is a column that has number and text (on different cells), like the one at Item5880: http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item5880?sortcol=1;table=3;up=0#sorted_table

-- TWiki:Main.GilmarSantosJr - 01 Oct 2008

Fixed this now.

-- TWiki:Main.ArthurClemens - 01 Oct 2008

Had this really been related to TablePlugin or was this a core bug? Anyway it should be part of the next bug release!

-- TWiki:Main.FranzJosefGigler - 02 Oct 2008

This was a TablePlugin bug. The column got defined as text, not as date column.

-- TWiki:Main.ArthurClemens - 02 Oct 2008

I reopened this only to commit a minor fix to make tests work on TWikiRelease04x02

-- TWiki:Main.GilmarSantosJr - 04 Oct 2008
Topic revision: r21 - 08 Jan 2009, KwangErnLiew
 
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons License