Opened 4 years ago
Closed 4 years ago
#1485966 closed Bugs (wontfix)
folder list should sort special characters (like @ or !) according to their ascii-order
| Reported by: | schneeland | Owned by: | |
|---|---|---|---|
| Priority: | 5 | Milestone: | 0.3-stable |
| Component: | User Interface | Version: | 0.2.2 |
| Severity: | minor | Keywords: | folder list, sorting |
| Cc: |
Description
In desktop email clients the sorting order of the folder list follows the ascii-order, which allows the user to deliberately push folders to the top by adding an @- or !-prefix to their regular name. (for example when implementing Getting Things Done, the user can put folders like @Action or @WaitingFor? at the top of their folder list).
Roundcube however ignores the special characters and lists the corresponding folders at a place according to their name without prefix.
It would be nice, if the sorting order could be fixed.
Attachments (1)
Change History (6)
Changed 4 years ago by schneeland
comment:1 Changed 4 years ago by alec
The list is sorted according to locale and it's good because folder name could start with national character.
comment:2 Changed 4 years ago by schneeland
Hi alec,
sorry for the imprecise wording. The locale on my server is de_DE.UTF-8. And according to http://www.utf8-zeichentabelle.de/ the @-character comes before any alpha-character. Furthermore, if I use the following php code
<?php
$folders = array("Posteingang",
"Entwürfe",
"Gesendet",
"Ablage",
"@Aufgaben",
"Finanzen",
"Überraschung",
"Ähnlicher Text",
"@Warten auf",
"Werbung");
sort($folders,SORT_LOCALE_STRING);
foreach ($folders as $key => $val) {
echo "folders[" . $key . "] = " . $val . "\n<br>\n";
}
?>
to test sorting on my server, the sorting order is as expected:
folders[0] = @Aufgaben folders[1] = @Warten auf folders[2] = Ablage folders[3] = Entwürfe folders[4] = Finanzen folders[5] = Gesendet folders[6] = Posteingang folders[7] = Werbung folders[8] = Ähnlicher Text folders[9] = Überraschung
Maybe you could point me to the file and function where folder sorting is done? It has been a good year since I last wrote PHP-code, but maybe I can try to track down that issue myself and if no change to the roundcube codebase is desired, just patch it on my server.
Best,
S.
comment:3 Changed 4 years ago by alec
- Milestone changed from later to 0.3-stable
_sort_mailbox_list() in include/rcube_imap.php
comment:4 Changed 4 years ago by schneeland
Thanks,
I changed the behaviour by resorting to
asort($folders, SORT_STRING);
As using SORT_LOCALE_STRING also exhibits other oddities, I guess I will just file a bug against PHP.
Sorry for taking your time,
S.
comment:5 Changed 4 years ago by alec
- Resolution set to wontfix
- Status changed from new to closed

Personal folder list exemplifying the problem