I am not sure what the current sort order is of attachments in the attachment table of TWiki 4. Cairo had the sequence of file uploads. TWiki 4 has some random order, it is nor the sequence of file uploads nor alphabetical order.
TWiki 4.1 should store FILE:ATTACHMENT either in sequence of file uploads or alphabetical order. I think most people would expect alphabetical order.
--
PTh
The order is the time taken from the
date
field in the FILEATTACHMENT.
See also
Item1743 which changed it to upload order for consistency with Cairo, and was released in 4.0.2.
foreach my $attachment (
sort { ( $a->{date} || 0) <=> ( $b->{date} || 0 )}
@attachments ) {
AFAICT from my own install, it is working correctly (as per this spec). Can you provide a testcase that behaves differently? Have you a Codev topic that discusses changing this spec?
CC
Ah, that explains it, last upload timestamp (Dakar) = timestamp of first upload (Cairo). If sort by first upload can't be done easily I suggest to ASCII-sort by filename.
--
PTh
If you have a lot of attachments that the last one uploaded can be found at the bottom of the list. That will be of help for other users (that do not know the filename).
AC
Still, I find alphabetical order or order of first uplod more intuitive than last upload.
--
PTh
OIC; Cairo never rewrote the
date
field of an upload? I hadn't realised that.
This is a matter of opinion (as so many things are). I find sorting by date of first upload ("creation date" if you like) totally counter-intuitive. I really don't care when an attachment was added; I care when it was last
modified.
Note that the attachment list is rather like an Windows Explorer window, so it makes sense to take a lead from that. In an Explorer window, if you select "Details" - the view most like the attachments list - you get the file Name, Size, Type and Date Modified. This is what TWiki currently shows. You can also add Date Created etc, but they are not shown by default.
One thing we can agree on is that a default alpha sort order is more intuitive. other sort orders can be imposed by TablePlugin, in an Explorer-like way.
CC
Yep, alpha sort order by default is acceptable by all.
--
PTh
I agree. Alpha sort is OK
KJL
Sorted using
cmp
on attachment name.
CC