Adding mix:shareable mixin is not effective until save()
--------------------------------------------------------

                 Key: JCR-2599
                 URL: https://issues.apache.org/jira/browse/JCR-2599
             Project: Jackrabbit Content Repository
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: 2.0.0
            Reporter: Thomas Draier


Hi,

After adding the mix:shareable mixin to a node - the node is not directly 
usable for a clone. The NodeImpl.isShareable() method still returns false. 
Trying to clone it before doing a save lead to the following exception :

javax.jcr.RepositoryException: node /test is not shareable.
        at 
org.apache.jackrabbit.core.NodeImpl.addShareParent(NodeImpl.java:3039)
        at org.apache.jackrabbit.core.NodeImpl.clone(NodeImpl.java:1907)

After saving the node, it's possible to clone without error.

This can be fixed by adding the following code at the end of NodeImpl.addMixin 
: 

            if (mixin.isDerivedFrom(NameConstants.MIX_SHAREABLE)) {
                thisState.addShare(getParentId());
            }   

Regards

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to