Uploaded image for project: 'Live Copy'
  1. Live Copy
  2. LIVECOPY-312

getReferencedLiveCopyNodeById does not match the correct candidate

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Medium 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
        • 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

              aichimescu Andrei Ichimescu
              hloepprich Horst Loepprich
              AuthorX
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD