learnweb / moodle-tool_lifecycle

:recycle: Extensible Moodle plugin for managing course life cycles, e.g., deprovisioning
GNU General Public License v3.0
19 stars 31 forks source link

Update `sortindex` of remaining workflows when disabling a workflow #201

Closed olivabigyo closed 4 months ago

olivabigyo commented 4 months ago

Disabling a workflow just removes it from the sort order without updating the sortindex of the remaining active workflow. This leaves a gap in the sortindex, which can cause different problems: eg., you can't "move up" the workflow which was immediately below the disabled one, or "move down" the one which was above it. Or, if you now activate a new workflow, it will get the same sortindex as the previously last one…

This is the root cause of the problems reported in issue #128.

This PR adds a function to workflow_manager.php to rearrange the sortindex of the remaining workflows when disabling a workflow.

NinaHerrmann commented 4 months ago

Seems like there were only some problems with the nodejs container and rerunning fixed it. Thank you again so much for providing a solution that fast!