Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3098

Bulk operation MoveNodeAction: "Move After" is reverting the chosen Node order

XMLWordPrintable

      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.

        Acceptance criteria

          1. MoveNodeAction-M5.2.5.patch
            2 kB
            Christian Ringele
          2. MoveNodeAction-M5.3.1.patch
            2 kB
            Christian Ringele

              dlipp Daniel Lipp
              cringele Christian Ringele
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD