You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Radu Cotescu (JIRA)" <ji...@apache.org> on 2015/07/29 12:09:04 UTC

[jira] [Created] (SLING-4915) Order of sub-nodes is not maintained in case of a merge

Radu Cotescu created SLING-4915:
-----------------------------------

             Summary: Order of sub-nodes is not maintained in case of a merge
                 Key: SLING-4915
                 URL: https://issues.apache.org/jira/browse/SLING-4915
             Project: Sling
          Issue Type: Bug
          Components: ResourceResolver
    Affects Versions: Resource Merger 1.2.10
            Reporter: Radu Cotescu
            Priority: Minor
             Fix For: Resource Merger 1.2.12


Given two content structures that should be merged by the Resource Merger, if the second tree contains all the sub-nodes of the first tree, a new node added in the second tree will always be added towards the end, irrespective of its position in the sub-node tree.

Example:
{noformat}
/libs/p1/components/c1
  node1
  node2
  node3
/libs/p2/components/c1 (sling:resourceSuperType=/libs/p1/components/c1)
  node1
  node4
  node2
  node3
{noformat}

When iterating over the child resources of {{/libs/p2/components/c1}}, {{node4}} will be the last child in the iteration instead of the second.

The workaround is to not define the redundant nodes and add the {{sling:orderBefore}} property on {{node4}}, however this should be handled by default by the merger.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)