mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
When working on discussions objects by noderef rather than name, check to see if it is part of a site so that activity entries can be generated properly if it is
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30192 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -209,6 +209,13 @@ public abstract class AbstractDiscussionWebScript extends DeclarativeWebScript
|
||||
protected void addActivityEntry(String thing, String event, TopicInfo topic,
|
||||
PostInfo post, SiteInfo site, WebScriptRequest req, JSONObject json)
|
||||
{
|
||||
// We can only add activities against a site
|
||||
if(site == null)
|
||||
{
|
||||
logger.info("Unable to add activity entry for " + thing + " " + event + " as no site given");
|
||||
return;
|
||||
}
|
||||
|
||||
// What page is this for?
|
||||
String page = req.getParameter("page");
|
||||
if(page == null && json != null)
|
||||
@@ -556,6 +563,21 @@ public abstract class AbstractDiscussionWebScript extends DeclarativeWebScript
|
||||
topic = objects.getFirst();
|
||||
post = objects.getSecond();
|
||||
}
|
||||
|
||||
// See if it's actually attached to a site
|
||||
if(topic != null)
|
||||
{
|
||||
NodeRef container = topic.getContainerNodeRef();
|
||||
if(container != null)
|
||||
{
|
||||
NodeRef maybeSite = nodeService.getPrimaryParent(container).getParentRef();
|
||||
if(maybeSite != null)
|
||||
{
|
||||
// Try to make it a site, will return Null if it isn't one
|
||||
site = siteService.getSite(maybeSite);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user