Details
-
Improvement
-
Resolution: Duplicate
-
Critical
-
None
-
3.2.8
-
None
Description
Components which are unique to the slave site are reordered to the bottom after a master push.
Reproduce
- Add 2 components to master
- Push master to slave
- Add new component on slave between the 2 components
- Push master to slave
Expected
Component added in step3 remains at same position (between first and second component)
Actual
Component added in step3 is now at the bottom
Notes
The change in order is happening during the execution of orderContentNodesInArea. When I get to the session save at the end the node is then pushed to the bottom.
To be considered:
- Referenced nodes don't change order
- Referenced nodes don't change order but contain unreferenced nodes.
- Referenced nodes change order.
- Referenced nodes change order and contain unreferenced nodes.
Also how to handle a referenced area which has had referenced nodes moved around. What if master has been reordered one way and the referenced ordered another way (purposely). Or is this scenario not supported? In other words, is the order of the master is always respected on a push? I think the only feasible option is to say the master always controls the order of referenced nodes but perhaps needs to be explicitly documented.
OR maybe another possibility is if the number of nodes in the master are is not equal to the number of nodes in the referenced area then ordering is not performed. For example:
/**
* Order the nodes present on the reference page like ordered on the master page.
*/
protected void orderContentNodesInArea(Node masterContentArea, Node referenceContentArea)
throws RepositoryException {
NodeIterator masterContentChildNodes = masterContentArea.getNodes();
NodeIterator referencedContentChildNodes = referenceContentArea.getNodes();
Long masterSize = masterContentChildNodes.getSize();
if (masterSize != referencedContentChildNodes.getSize()) {
String path = referenceContentArea != null ? referenceContentArea.getPath() : "";
log.info("Skipping reordering of referenced content area {} becuase of size mismatch.", path);
}
else if (masterSize > 1) {
Node masterContentChildNode = masterContentChildNodes.nextNode();
...
...
Checklists
Attachments
Issue Links
- relates to
-
LIVECOPY-294 (DRAFT) Implement logic for referenced LC ordering
-
- Open
-