New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

Item8700: Sorting mixed data types gives unexpected results

Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Extension
Component: TablePlugin
Reported By: ArthurClemens
Waiting For:
Last Change By: KennethLavrsen
Test case:

DatesSorted ascending
19-Dec-2001 - 23:59
20 Dec 2001 - 23:59
21 Dec 2001
2001/12/27 23:59:59
2001/12/28 23:59
2001-12-29 - 23:59
2001-12-31 23:59

This is because 2009 is considered a number, not a date.

We also have problems sorting empty cells:

number of thingsSorted ascending
-1.1 thingies
1 thingy
2 thingies
2.0 thingies
9.99 thingies
10.1 thingies
20 thingies

and mixed numbers and text:

mostly numbersSorted ascending
ls -al

This is because the code now assumes a column type to sort on. If a column type is numbers, an empty cell invalidates the column type and further processing is stopped and sorted is done with column type of UNDEFINED.

I have removed the column type concept to just sort on the value, whether it is text, a number, empty or a date.

If you like to test this on your installation, attached is the trunk version of the plugin that - should - work on Foswiki 1.0.9.

-- ArthurClemens - 13 Mar 2010

I tried the attached version; it's a nice solution to sort mixed type columns, but I don't know if sorting of mixed number-and-date columns will ever be satisfactory because common values like '2009' and '2001.12' are ambiguous and because there's no expectation for how numbers and dates order.

-- MegCrocker - 16 Mar 2010

ItemTemplate edit

Summary Sorting mixed data types gives unexpected results
ReportedBy ArthurClemens
Codebase trunk
SVN Range
AppliesTo Extension
Component TablePlugin
Priority Normal
CurrentState Closed
Checkins distro:ca57d89dbb6d
TargetRelease minor
ReleasedIn 1.1.0
Topic attachments
I Attachment Action Size Date Who Comment
TablePlugin.zipzip manage 27 K 13 Mar 2010 - 16:20 ArthurClemens TablePlugin version 1.122
Topic revision: r4 - 04 Oct 2010, KennethLavrsen - This page was cached on 01 May 2018 - 19:08.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License