FIXED : ALF-11683: Failure occurs when Site Contributor tries to add first comment to the post

fm:commentsRollup now being added by the service instead of the webscript

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32337 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gethin James
2011-11-28 11:42:28 +00:00
parent eef1e7cd7f
commit 6bea93cd7d
2 changed files with 1 additions and 6 deletions

View File

@@ -21,12 +21,6 @@ function addComment(node)
// get a unique name // get a unique name
var name = getUniqueChildName(commentsFolder, "comment"); var name = getUniqueChildName(commentsFolder, "comment");
// Add the comments rollup aspect to the commented-upon node.
if (!node.hasAspect("fm:commentsRollup"))
{
node.addAspect("fm:commentsRollup");
}
// create the comment // create the comment
var commentNode = commentsFolder.createNode(name, "fm:post"); var commentNode = commentsFolder.createNode(name, "fm:post");
commentNode.mimetype = "text/html"; commentNode.mimetype = "text/html";

View File

@@ -80,6 +80,7 @@ public class ScriptCommentService extends BaseScopableProcessorExtension
try try
{ {
nodeService.addAspect(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussable"), null); nodeService.addAspect(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussable"), null);
nodeService.addAspect(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "commentsRollup"), null);
List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussion"), RegexQNamePattern.MATCH_ALL); List<ChildAssociationRef> assocs = nodeService.getChildAssocs(nodeRef, QName.createQName(NamespaceService.FORUMS_MODEL_1_0_URI, "discussion"), RegexQNamePattern.MATCH_ALL);
if (assocs.size() != 0) if (assocs.size() != 0)
{ {