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

onChildNodes does not work correctly with more then one child operation

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5.7
    • Fix Version/s: None
    • Component/s: core
    • Labels:
      None

      Description

      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);
        }
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              frank.sommer Frank Sommer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: