Thank you, @texnixe, for the support!
These are my findings after applying the suggested fix by afbora:
- all selected files get deleted (not just one)
- new sorting numbers get applied in sequence (no holes)
- BUT the ordering of the remaining pages gets reversed
For example I add 9 pages. You can see their ordering by their slug:
Now I delete the last two:
The ordering now is reversed. When I delete more pages, the ordering reverses again.
My code used for deleting the subpages is the same as shown in the post above.