-
Bug
-
Resolution: Cannot Reproduce
-
Medium
-
None
-
3.2.7
AS-IS:
- it is possibel that getReferencedLiveCopyNodeById finds more than one candidate for a component copy
- the filter tries to match the masterNode path with the candidate node path
- the filter never matches if the paths contain the site name, e.g. /master/... and /travel/...
- if no match is found, the first entry in the candidate list is returned
Got more than 1 candidate for node /master/business/insurance/relatedContent/06 -> [node /it/business/Retail/relatedContent/06, node /it/business/insurance/relatedContent/06]. Using node /it/business/Retail/relatedContent/06
- the first entry in the list may not be the candidate that should be further processed
- e.g. candidate has different nodes than the original and reordering of child nodes fails
WrappedException: javax.jcr.ItemNotFoundException: node /it/business/Retail/relatedContent/06 has no child node with name 05
- e.g. candidate has different nodes than the original and reordering of child nodes fails
-
- this can be the case if the candidate was copied from another page, pasted to a new page and then modified
A possible solution for the filter would be to remove the site from the path before comparison:
Node resultNode = candidates.stream() .filter(n -> Exceptions.sneak().get(() -> masterPath.replaceFirst("^/\\w*", "") .equals(n.getPath().replaceFirst("^/\\w*", "")) )) .findFirst() .orElse(candidates.get(0));
But this will only work if the rest of the path is the same as the master.
Another solution would be to skip the further processing of the node if the children do not match the master and display a warning to the user that a node was skipped. Currently the whole push process just fails with an error.
Acceptance criteria
- relates to
-
LIVECOPY-220 ItemNotFound in Push Master Changes
- Closed