mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-1973 Handle the case of a discussion post having been created by a user who has subsequently been deleted
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31294 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||
"${fieldName}":
|
||||
{
|
||||
<#if person?has_content>
|
||||
<#if person.assocs["cm:avatar"]??>
|
||||
"avatarRef": "${person.assocs["cm:avatar"][0].nodeRef?string}",
|
||||
</#if>
|
||||
"username": "${person.properties["cm:userName"]}",
|
||||
"firstName": "${person.properties["cm:firstName"]!""}",
|
||||
"lastName": "${person.properties["cm:lastName"]!""}"
|
||||
</#if>
|
||||
},
|
||||
</#escape>
|
||||
</#macro>
|
||||
|
@@ -38,6 +38,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.security.AccessStatus;
|
||||
import org.alfresco.service.cmr.security.NoSuchPersonException;
|
||||
import org.alfresco.service.cmr.security.PermissionService;
|
||||
import org.alfresco.service.cmr.security.PersonService;
|
||||
import org.alfresco.service.cmr.site.SiteInfo;
|
||||
@@ -272,16 +273,26 @@ public abstract class AbstractDiscussionWebScript extends DeclarativeWebScript
|
||||
|
||||
protected Object buildPerson(String username)
|
||||
{
|
||||
// Empty string needed if the user can't be found
|
||||
Object noSuchPersonResponse = "";
|
||||
|
||||
if (username == null || username.length() == 0)
|
||||
{
|
||||
// Empty string needed
|
||||
return "";
|
||||
return noSuchPersonResponse;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// Will turn into a Script Node needed of the person
|
||||
NodeRef person = personService.getPerson(username);
|
||||
return person;
|
||||
}
|
||||
catch(NoSuchPersonException e)
|
||||
{
|
||||
// This is normally caused by the person having been deleted
|
||||
return noSuchPersonResponse;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Was topicpost.lib.js getReplyPostData
|
||||
|
Reference in New Issue
Block a user