Gargaj / wuhu

Lightweight Party Management System
http://wuhu.function.hu/
Other
41 stars 26 forks source link

Defragment compos when entries are moved out #63

Open psenough opened 2 years ago

psenough commented 2 years ago

If you select the option to move a prod to another compo and the prod is not the last entry of the compo, it will leave a void in the entry order of the original compo (highlighted in red but hard to recover from), the dragentries plugin will then start throwing php errors if you try to reorder things. Only way to recover seems to be to either edit the database directly or to move out all the remaining red marked entries from the compo one by one and move them back in.

Would be nice if moving the entry would also update the order of all prods; or only allow to move an entry when it's already the last entry of the compo; or dragentries plugin to override those errors automatically afterwards to become an easy fix.

Gargaj commented 2 years ago

The error is fixed in https://github.com/Gargaj/wuhu/commit/21ba967fad732b9ea0b3f0901be20d0cc9b50e43 - but yes, compos should defragment when entries get moved out.