Duplicating an existing folder causes a lot of problems with sorting in the new folder. I had to create a script to redo all the menuindex values inside a folder to fix this problem
In general, I want to NOT duplicate menuindexes when duplicating a resource. That makes sorting work properly, since I don't have to deal with duplicate menuindexes. However, when I duplicate a folder that has children, and I want the new folder to NOT duplicate the menuindex of the original, I want the children of the new folder to retain the original menuindexes so that they are sorted properly.
With the system setting "preserve_menuindex" turned off, after duplicating a folder, the new folder has a new menuindex, which is what I want, but ALL the children of the new folder will have the same menuindex as each other (the value of the largest menuindex of the children in the original folder). Since all the menuindex values of the children are now the same, the order can be completely different from the original folder, since sorting by menuindex doesn't do what's expected. If there are any folders inside the original folder, all those children will also have the same index as each other rather than retain the original menuindex values.
It would be great to have an option to ratain menuindexes on children when duplicating a folder, independent of the system setting "preserve_menuindex". This could be accomplished one of two ways:
All versions of MODX
If you duplicate a resource with children it doesn't make sense to re-order the children, even if you don't preserve the menu index of the parent. In my opinion we need to keep the menu index of the original, or at least recalculate the menu index of the children but in the same order as the original.
Most helpful comment
If you duplicate a resource with children it doesn't make sense to re-order the children, even if you don't preserve the menu index of the parent. In my opinion we need to keep the menu index of the original, or at least recalculate the menu index of the children but in the same order as the original.