Author Topic: Folder tree sort order  (Read 3141 times)

Offline jamtur01

  • Newbie
  • *
  • Posts: 9
Folder tree sort order
« on: February 18, 2007, 08:23:31 PM »
I noticed that Folder sort order in the Folders tree is a little broken.

Currently sort order is upper case folders first (A B C) etc sub-sorted alphabetically and then lowercase folders (a b c) also sub-sorted alphabetically. This leads to:

Folder Tree:

Apple
Berry
Candy
anteater
beaver
clam

Surely the right sort order should be:

anteater
apple
beaver
Berry
Candy
clam

This is in the 0.1 beta release 2.

Thanks

Offline jamtur01

  • Newbie
  • *
  • Posts: 9
Re: Folder tree sort order
« Reply #1 on: April 01, 2007, 08:15:37 PM »
I have tracked this issue down to the following function:

function _sort_mailbox_list($a_folders);

with the following sorts:

sort($a_out);
ksort($a_defaults);

The sort seems to be broken. I am not a PHP person so I don't know what can be done to actually sort in mixed-case.

Offline jamtur01

  • Newbie
  • *
  • Posts: 9
Re: Folder tree sort order
« Reply #2 on: April 01, 2007, 08:19:25 PM »
Actually I spoke too soon. Changing the following (in program/include/rcube_imap.inc):

sort($a_out);

to

natcasesort($a_out);

Fixes this issue.

Hope that helps someone.