Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1721

Session.move doesn't seem to work when same name siblings are not allowed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.1.0.Final
    • 3.0.0.Final
    • API
    • None

      When renaming a node (i.e. keeping the same parent) using Session.move(srcPath, destPath), where the parent node doesn't allow same name siblings, the following exception is thrown:

      Caused by: javax.jcr.ItemExistsException: A node definition that allows same name siblings could not be found for the node ...
      

      This seems to be caused by the following line in JcrSession.move:

      destParentNode.validateChildNodeDefinition(srcNode.name(), srcNode.getPrimaryTypeName(), true);
      

      I think it should read the following instead:

      destParentNode.validateChildNodeDefinition(destPath.getLastSegment().getName(), srcNode.getPrimaryTypeName(), true);
      

              rhauch Randall Hauch (Inactive)
              herculeszeus_jira Hercules Zeus (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: