Scenario sorting issues
When scenarios are sorted using the web admin, it is possible for many scenarios to be given the same value for "Sort" in the "CommandGroup_EntertainArea" table. This caused the following issues:
- When moving a scenario up or down into a cluster of scenarios with the same value for "Sort", the scenario is moved unexpectedly far in the list. There is no way for the user to understand why this happens, nor is there a way for the user to correct it.
- Some scenarios will seemingly randomly disappear from the home screen in UI1. The number of missing scenarios seems to be related to the number of scenarios with the same Sort value. i.e. the number of displayed scenarios is COUNT('Sort')
The attached patch addresses this issue in the following way:
- Before moving scenarios, all Sort values are set incrementally (starting at 1 in steps of 5). This preserves the order that the user saw on the screen even if there are scenarios with the same 'Sort' value.
- To move scenarios, the sort values of the two scenarios that need reordering are swapped.
- The only file affected is http://svn.linuxmce.org/svn/branches/LinuxMCE-0810/web/lmce-admin/operations/myScenarios/sortScenarios.php