From f3e6780ff763c6e9a4ae1d292d1b882db6b49d09 Mon Sep 17 00:00:00 2001 From: Andrei Rebegea Date: Wed, 14 Jun 2017 17:02:36 +0000 Subject: [PATCH] Merged 5.2.N (5.2.2) to HEAD (5.2) 135306 cturlica: Merged 5.2.0-CLOUD45 (Cloud ) to 5.2.N (5.2.1) 135265 cturlica: CLD-67: TestSiteMembershipRequests tests failing after cloud update from 5.2-SNAPSHOT to 5.2.0-CLOUD45-SNAPSHOT (plat/share) - we shouldn't have default null value for not set properties (partial change for REPO-892) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@137385 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/rest/api/model/Person.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/source/java/org/alfresco/rest/api/model/Person.java b/source/java/org/alfresco/rest/api/model/Person.java index 9c6d10a781..1174da470a 100644 --- a/source/java/org/alfresco/rest/api/model/Person.java +++ b/source/java/org/alfresco/rest/api/model/Person.java @@ -113,7 +113,10 @@ public class Person implements Serializable setLocation(location); setTelephone(telephone); setMobile(mobile); - setEmail(email); + if (email != null) + { + setEmail(email); + } setSkypeId(skypeId); setInstantMessageId(instantMessageId); setUserStatus(userStatus); @@ -125,7 +128,10 @@ public class Person implements Serializable // system-maintained / derived setStatusUpdatedAt(statusUpdatedAt); setQuota(quota); - setQuotaUsed(quotaUsed); + if (quotaUsed != null) + { + setQuotaUsed(quotaUsed); + } } public Person(NodeRef nodeRef, Map nodeProps, boolean enabled) @@ -489,7 +495,10 @@ public class Person implements Serializable addToMap(properties, ContentModel.PROP_LOCATION, getLocation()); addToMap(properties, ContentModel.PROP_TELEPHONE, getTelephone()); addToMap(properties, ContentModel.PROP_MOBILE, getMobile()); - addToMap(properties, ContentModel.PROP_EMAIL, getEmail()); + if (wasSet(ContentModel.PROP_EMAIL)) + { + addToMap(properties, ContentModel.PROP_EMAIL, getEmail()); + } if (wasSet(PROP_PERSON_COMPANY)) { @@ -568,7 +577,10 @@ public class Person implements Serializable addToMap(properties, ContentModel.PROP_USER_STATUS_TIME, getStatusUpdatedAt()); addToMap(properties, ContentModel.PROP_GOOGLEUSERNAME, getGoogleId()); addToMap(properties, ContentModel.PROP_SIZE_QUOTA, getQuota()); - addToMap(properties, ContentModel.PROP_SIZE_CURRENT, getQuotaUsed()); + if (wasSet(ContentModel.PROP_SIZE_CURRENT)) + { + addToMap(properties, ContentModel.PROP_SIZE_CURRENT, getQuotaUsed()); + } addToMap(properties, ContentModel.PROP_PERSONDESC, getDescription()); addToMap(properties, ContentModel.PROP_ENABLED, isEnabled());