mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Current master has sorting broken and the order reverses as opposed to what is set if sortkey.algorithm is set to true. The problem lies in the way the update APIs were being called by the UI. The code was agnostic to a global config that backend uses to set the order of the entities in the corresponding list APIs. We need to make UI aware of the global config and instead of changing sign of sort key pass proper numbers so that DB isn't confusing when some tables have positive sortkey and some have negative. The fix is in 2 steps- 1) Make use of sortkey name in place where it's relevant. Mere row index is not sufficient. 2) Reverse the sortkey if we are sorting by descending (when global config is false)