diff --git a/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java b/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java index 9f864f1b1c..6bdb4e2e6c 100644 --- a/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/blogs/AbstractBlogWebScript.java @@ -243,10 +243,10 @@ public abstract class AbstractBlogWebScript extends DeclarativeWebScript } else { - // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item + // The NodeRef is the container (if it exists) if (siteService.hasContainer(siteName, BlogServiceImpl.BLOG_COMPONENT)) { - nodeRef = site.getNodeRef(); + nodeRef = siteService.getContainer(siteName, BlogServiceImpl.BLOG_COMPONENT); } } } diff --git a/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java b/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java index 73bcdf28a8..99f181d0cd 100644 --- a/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java +++ b/source/java/org/alfresco/repo/web/scripts/discussion/AbstractDiscussionWebScript.java @@ -533,10 +533,10 @@ public abstract class AbstractDiscussionWebScript extends DeclarativeWebScript } else { - // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item + // The NodeRef is the container (if it exists) if (siteService.hasContainer(siteName, DiscussionServiceImpl.DISCUSSION_COMPONENT)) { - nodeRef = site.getNodeRef(); + nodeRef = siteService.getContainer(siteName, DiscussionServiceImpl.DISCUSSION_COMPONENT); } } } diff --git a/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java b/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java index ffa283f754..5f67eb806d 100644 --- a/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java +++ b/source/java/org/alfresco/repo/web/scripts/links/LinksListGet.java @@ -140,8 +140,25 @@ public class LinksListGet extends AbstractLinksWebScript } // We need the container node for permissions checking - // MNT-11854 Consumer allowed to create Discussion, Wiki, Blog and Link if she/he creates the first item - NodeRef container = site.getNodeRef(); + NodeRef container; + if (links.getPage().size() > 0) + { + container = links.getPage().get(0).getContainerNodeRef(); + } + else + { + // Find the container (if it's been created yet) + container = siteService.getContainer( + site.getShortName(), LinksServiceImpl.LINKS_COMPONENT); + + if (container == null) + { + // Brand new site, no write operations on links have happened + // Fudge it for now with the site itself, the first write call + // will have the container created + container = site.getNodeRef(); + } + } // All done Map model = new HashMap();