Merged 5.2.0 (5.2.0) to HEAD (5.2)

133846 rmunteanu: REPO-1746: Merge fixes for 5.2 GA issues to 5.2.0 branch
      Merged 5.2.N (5.2.1) to 5.2.0 (5.2.0)
         133293 jvonka: 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/HEAD/root@134185 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2017-01-11 10:34:34 +00:00
parent 2b1c7382d1
commit c65142425d
7 changed files with 384 additions and 128 deletions

View File

@@ -492,8 +492,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;
}
});
@@ -572,7 +579,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);