The chart is saving order correctly to the database, but when reading from the database order is the order in the table (not the order field). This read in order is then assigned to the items, then is written out incorrectly. I'm not sure how
$orderItems = ! empty($orderField['fieldId']) ? 'f_' . $orderField['fieldId'] . '_asc' : 'created_asc'; $listItems = $trklib->list_items($trackerId, 0, -1, $orderItems, $listfields);
is supposed to work.
A temporary fix is to sort the items by order immediately after they are read from the database.
In tiki/lib/wiki-plugins/wikiplugin_ganttchart.php line 211 add:
$orderKey = array_search($order, array_column($listfields, 'permName')); function array_sort($arrayToSort, $orderKey) { $new_array = array(); $sortable_array = array(); if (count($arrayToSort) > 0) { foreach ($arrayToSort as $k => $v) { $sortable_array[$k] = $v['field_values'][$orderKey]['value']; } } asort($sortable_array); foreach ($sortable_array as $k => $v) { $new_array[$k] = $arrayToSort[$k]; } return $new_array; } $listItems['data'] = array_sort($listItems['data'], $orderKey);
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |