Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

108041: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud)
      107608: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3)
         107462: Merged V4.1-BUG-FIX (4.1.11) to V4.2-BUG-FIX (4.2.5)
            107375: Merged DEV to V4.1-BUG-FIX (4.1.11)
               100814 : MNT-13719: CLONE - Comments' counter is working incorrectly after reversion major version of the uploaded document.
                  - Always restore forum properties


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@108072 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-07-09 22:10:37 +00:00
parent 6c2b75c970
commit 38a97282c6

View File

@@ -1019,18 +1019,14 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
Map<QName, Serializable> forumProps = null;
// Collect forum properties
// only if previous version hasn't discussable aspect
if (needToRestoreDiscussion)
// always collect forum properties
Map<QName, Serializable> currentVersionProp = this.nodeService.getProperties(nodeRef);
forumProps = new HashMap<QName, Serializable>();
for (QName key : currentVersionProp.keySet())
{
Map<QName, Serializable> currentVersionProp = this.nodeService.getProperties(nodeRef);
forumProps = new HashMap<QName, Serializable>();
for (QName key : currentVersionProp.keySet())
if (key.getNamespaceURI().equals(NamespaceService.FORUMS_MODEL_1_0_URI))
{
if (key.getNamespaceURI().equals(NamespaceService.FORUMS_MODEL_1_0_URI))
{
forumProps.put(key, currentVersionProp.get(key));
}
forumProps.put(key, currentVersionProp.get(key));
}
}
@@ -1089,10 +1085,7 @@ public class Version2ServiceImpl extends VersionServiceImpl implements VersionSe
this.nodeService.setProperties(nodeRef, newProps);
//Restore forum properties
if (needToRestoreDiscussion)
{
this.nodeService.addProperties(nodeRef, forumProps);
}
this.nodeService.addProperties(nodeRef, forumProps);
Set<QName> aspectsToRemove = new HashSet<QName>(oldAspectQNames);
aspectsToRemove.removeAll(newAspectQNames);