-
Bug
-
Resolution: Fixed
-
Major
-
5.2.8, 5.3.2
Summary:
When moving a selection of Nodes with the "Move After" operation, their order is reversed.
The reason is that for each Node the moveAfter() is called, which reverses its original order:
The last Node is placed as last element directly after the target node -> its then the first Node and not the last anymore.
Cause:
Super class of MoveNodeAction abstract class is
info.magnolia.ui.framework.action.AbstractMultiItemAction
It calls in the execute() for every item operating on the abstract method .executeOnItem(JcrItemAdapter).
The MoveNodeAction implementing the method executeOnItem is calling
info.magnolia.ui.workbench.tree.MoveHandler.moveItem(Item, Item, MoveLocation)
which in the end calls
info.magnolia.jcr.util.NodeUtil.moveNodeAfter(Node, Node)
Solution general:
Override the method
info.magnolia.ui.contentapp.movedialog.action.MoveNodeAction.getSortedItems(Comparator<JcrItemAdapter>)
of the super class and revert the list on the MoveLoction.after operation.
Solution patches:
As the code changed form 5.2 to 5.3 of this class, I needed to create two different patches basically containing the same code. Just the line numbers won't match.