mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
REPO-1646: V1 REST API - cannot unset optional fields (eg. when updating person / site details ...)
- part 2 (Update Person) - REPO-1268, REPO-893 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@133293 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -486,8 +486,15 @@ public class PeopleImpl implements People
|
||||
@Override
|
||||
public Void doWork() throws Exception
|
||||
{
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_PERSONDESC, true);
|
||||
writer.putContent(description);
|
||||
if (description != null)
|
||||
{
|
||||
ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_PERSONDESC, true);
|
||||
writer.putContent(description);
|
||||
}
|
||||
else
|
||||
{
|
||||
nodeService.setProperty(nodeRef, ContentModel.PROP_PERSONDESC, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
@@ -566,7 +573,7 @@ public class PeopleImpl implements People
|
||||
}
|
||||
|
||||
NodeRef personNodeRef = personService.getPerson(personIdToUpdate, false);
|
||||
if (person.getDescription() != null)
|
||||
if (person.wasSet(Person.PROP_PERSON_DESCRIPTION))
|
||||
{
|
||||
// Remove person description from saved properties
|
||||
properties.remove(ContentModel.PROP_PERSONDESC);
|
||||
|
Reference in New Issue
Block a user