From: Mathieu Baudier Date: Wed, 25 Nov 2020 11:07:10 +0000 (+0100) Subject: Add mixins before copying properties. X-Git-Tag: argeo-commons-2.1.89~19 X-Git-Url: https://git.argeo.org/?p=lgpl%2Fargeo-commons.git;a=commitdiff_plain;h=3b38491015a84964a3565cdf51e265b45659dd0a Add mixins before copying properties. --- diff --git a/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java b/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java index c12a60fff..af8aca69b 100644 --- a/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java +++ b/org.argeo.jcr/src/org/argeo/jcr/JcrUtils.java @@ -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()) {