Sorting in threaded mail view w/ PHP <= 5.2.8
|Reported by:||stenjan||Owned by:|
|Severity:||normal||Keywords:||mails, threaded view, sorting|
We are running RoundCube 0.8.1 with PHP 5.2.6 (minimum requirement according to INSTALL file: 5.2.1). Changing the sort order when having the threaded mail view enabled does not have any effect on the order in which mails are listed.
Having tracked down the problem, we found that program/include/rcube_result_thread::sort invokes array_unique($result, SORT_NUMERIC), but the sort_flags first appeared in PHP 5.2.9. The following patch for program/include/rcube_result_thread.php seems to do the trick for us:
479c479,482 < $result[$elem] = $elem; --- > if ($root) > $result[$root] = $root; > else > $result[$elem] = $elem; 488c491 < $result = array_unique($result, SORT_NUMERIC); --- > $result = array_unique($result);
This might also be relevant for future releases, as RoundCube 0.8.2 seems to have the same problem.