mbaedke commented on code in PR #1141:
URL: https://github.com/apache/jackrabbit-oak/pull/1141#discussion_r1351745688


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/version/VersionEditor.java:
##########
@@ -108,9 +112,15 @@ public void propertyAdded(PropertyState after)
                 && this.after.hasProperty(JcrConstants.JCR_VERSIONHISTORY)
                 && !this.after.hasProperty(JCR_ISCHECKEDOUT)
                 && !this.before.exists()) {
-            // sentinel node for restore
-            vMgr.restore(node, after.getValue(Type.REFERENCE), null);
-            return;
+            Tree tree = new 
TreeProviderService().createReadOnlyTree(this.node.getNodeState());
+            if (vMgr.getNodeTypeManager().isNodeType(
+                    TreeUtil.getPrimaryTypeName(tree), 
TreeUtil.getMixinTypeNames(tree), MIX_VERSIONABLE)) {

Review Comment:
   @rishabhdaim No, that doesn't work, because isVersionable() also checks for 
the presence of the jcr:isCheckedOut property (indirectly, it uses another 
version of the NodeTypeManager.isNodeType() method, which uses this shortcut 
when checking for the presence of mix:versionable. That's ok for "real" nodes, 
because the property is autocreated and mandatory, but does not work for the 
sentinel node of the restore operation, which is just used internally and 
breaks this contract).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@jackrabbit.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to