mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
98874: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud) 98718: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2) 98561: Merged NESS/4.2.N-2015-02-10 (4.2.5) to V4.2-BUG-FIX (4.2.5) 98467: MNT-13358 : Share fails to render imported documents when metadata has empty cm:creator or cm:modifier values - modified the username decorator and the people bean to handle empty usernames 98550: MNT-13358 : Share fails to render imported documents when metadata has empty cm:creator or cm:modifier values - added unit tests and corrected formating of previous commit git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@98951 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -966,7 +966,7 @@ public class People extends BaseScopableProcessorExtension implements Initializi
|
||||
{
|
||||
NodeRef personRef = null;
|
||||
|
||||
ParameterCheck.mandatoryString("Username", username);
|
||||
ParameterCheck.mandatory("Username", username);
|
||||
try
|
||||
{
|
||||
personRef = personService.getPersonOrNull(username);
|
||||
|
@@ -60,7 +60,12 @@ public class UsernamePropertyDecorator extends BasePropertyDecorator
|
||||
// DO NOT change this to just use getPersonOrNullImpl
|
||||
// - there is Cloud THOR prod hack see personServiceImpl.personExists
|
||||
// - and THOR-293
|
||||
if (this.personService.personExists(username))
|
||||
if (username.isEmpty())
|
||||
{
|
||||
firstName = "";
|
||||
lastName = "";
|
||||
}
|
||||
else if (this.personService.personExists(username))
|
||||
{
|
||||
NodeRef personRef = this.personService.getPerson(username, false);
|
||||
firstName = (String)this.nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME);
|
||||
|
@@ -245,6 +245,13 @@ public class IntegrityTest extends TestCase
|
||||
checkIntegrityNoFailure();
|
||||
}
|
||||
|
||||
public void testCreateWithEmptyMandatoryProperty() throws Exception
|
||||
{
|
||||
allProperties.put(TEST_PROP_TEXT_A, "");
|
||||
NodeRef nodeRef = createNode("abc", TEST_TYPE_WITH_PROPERTIES, allProperties);
|
||||
checkIntegrityNoFailure();
|
||||
}
|
||||
|
||||
public void testMandatoryPropertiesRemoved() throws Exception
|
||||
{
|
||||
NodeRef nodeRef = createNode("abc", TEST_TYPE_WITH_PROPERTIES, allProperties);
|
||||
|
Reference in New Issue
Block a user