From time to time, the form elements of a form are reordered in a uncontrolled way, when editing a form.
Steps to reproduce:
- Create a form with 10 fields
- Edit the form
- see if error occurs
- if not, discard the draft and repeat at step 2.
There is no explicit order given in the database query, so it's up to the database if it is going to sort it by id or not. In most cases it does, but in few cases it doesn't.
The following patch would solve the problem: