Add mixins before copying properties.
authorMathieu Baudier <mbaudier@argeo.org>
Wed, 25 Nov 2020 11:07:10 +0000 (12:07 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Wed, 25 Nov 2020 11:07:10 +0000 (12:07 +0100)
org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java

index c12a60fffa6d80d5bef281095a2bc86d3437e5fa..af8aca69bedf7dbe766c4b31ae06957d4423a409 100644 (file)
@@ -731,6 +731,11 @@ public class JcrUtils {
                        if (toNode.getDefinition().isProtected())
                                return;
 
+                       // add mixins
+                       for (NodeType mixinType : fromNode.getMixinNodeTypes()) {
+                               toNode.addMixin(mixinType.getName());
+                       }
+
                        // process properties
                        PropertyIterator pit = fromNode.getProperties();
                        properties: while (pit.hasNext()) {
@@ -757,11 +762,6 @@ public class JcrUtils {
                        // they existed, before adding the mixins
                        updateLastModified(toNode, true);
 
-                       // add mixins
-                       for (NodeType mixinType : fromNode.getMixinNodeTypes()) {
-                               toNode.addMixin(mixinType.getName());
-                       }
-
                        // process children nodes
                        NodeIterator nit = fromNode.getNodes();
                        while (nit.hasNext()) {