mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-30 18:15:39 +00:00
Merged BRANCHES/V3.2 to HEAD:
19807: Fix ALF-2318 - failed to add WCM content (without description or title) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19815 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
464c52891b
commit
d6eeff6fb1
@ -257,6 +257,7 @@ public class PropertyValue implements Cloneable, Serializable
|
|||||||
@Override
|
@Override
|
||||||
protected ValueType getPersistedType(Serializable value)
|
protected ValueType getPersistedType(Serializable value)
|
||||||
{
|
{
|
||||||
|
// NOTE: since 2.2.1, PropertyValue is only used by AVM (which does not natively support MLText, other than single/default string)
|
||||||
if (value instanceof MLText)
|
if (value instanceof MLText)
|
||||||
{
|
{
|
||||||
MLText mlText = (MLText) value;
|
MLText mlText = (MLText) value;
|
||||||
@ -269,7 +270,7 @@ public class PropertyValue implements Cloneable, Serializable
|
|||||||
return ValueType.STRING;
|
return ValueType.STRING;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (value instanceof String)
|
else if ((value == null) || (value instanceof String))
|
||||||
{
|
{
|
||||||
return ValueType.STRING;
|
return ValueType.STRING;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ public class PropertyValueTest extends TestCase
|
|||||||
// single language
|
// single language
|
||||||
MLText mlText = new MLText(Locale.FRENCH, "bonjour");
|
MLText mlText = new MLText(Locale.FRENCH, "bonjour");
|
||||||
PropertyValue propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
PropertyValue propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
||||||
assertNotNull("MLText not persisted as a string", propertyValue.getStringValue());
|
assertEquals("MLText not persisted as a string", "bonjour", propertyValue.getStringValue());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -69,6 +69,16 @@ public class PropertyValueTest extends TestCase
|
|||||||
// NOTE: since 2.2.1, PropertyValue is only used by AVM (which does not natively support MLText, other than single/default string)
|
// NOTE: since 2.2.1, PropertyValue is only used by AVM (which does not natively support MLText, other than single/default string)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// single language - empty string
|
||||||
|
mlText = new MLText(Locale.FRENCH, "");
|
||||||
|
propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
||||||
|
assertEquals("MLText not persisted as an empty string", "", propertyValue.getStringValue());
|
||||||
|
|
||||||
|
// single language - null string
|
||||||
|
mlText = new MLText(Locale.GERMAN, null);
|
||||||
|
propertyValue = new PropertyValue(DataTypeDefinition.MLTEXT, mlText);
|
||||||
|
assertNull("MLText not persisted as a null string", propertyValue.getStringValue());
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user