Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7189

onChildNodes does not work correctly with more then one child operation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 5.5.7
    • core

      The onChildNodes operation iterates over the child nodes in a wrong way. Instead of doing all child operations for every node, it steps to the next node after every child operation.

      https://git.magnolia-cms.com/projects/PLATFORM/repos/main/browse/magnolia-core/src/main/java/info/magnolia/jcr/nodebuilder/Ops.java#238

      wrong code
      while (iter.hasNext()) {
        for (NodeOperation childrenOp : childrenOps) {
          childrenOp.exec(iter.nextNode(), errorHandler);
        }
      }
      
      correct code
      while (iter.hasNext()) {
        Node childNode = iter.nextNode();
        for (NodeOperation childrenOp : childrenOps) {
          childrenOp.exec(childNode, errorHandler);
        }
      }
      

        Acceptance criteria

              Unassigned Unassigned
              frank.sommer Frank Sommer
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD