Details
-
Type:
Bug
-
Status:
Contributed Solution
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 6.1.1 CE GA2
-
Fix Version/s: None
-
Component/s: Administration, Administration > Custom Fields
-
Labels:None
-
Liferay Contributor's Agreement:Accept
-
Similar Issues:
Description
this method gets data this way
String data = expandoValueLocalService.getData(
companyId, className, tableName, columnName, classPK,
StringPool.BLANK);
what means that only text type custom fields are supported. If they are arrays, booleans or numbers.
Even more, if the field has no value or a zero length string, it fails.
Even more, local retrieval of non existing columns are returned as null. The remote retrieval of unexisting columns throw an exception
Issue Links
- is duplicated by
-
LPS-14998
Custom Fileds - Type custom.field.java.lang.String.array is not compatible with type custom.field.java.lang.String
-

According to code
public JSONObject getJSONData(
long companyId, String className, String tableName,
String columnName, long classPK)
throws PortalException, SystemException {
ExpandoColumn column = expandoColumnLocalService.getColumn(
companyId, className, tableName, columnName);
if (ExpandoColumnPermissionUtil.contains(
getPermissionChecker(), column, ActionKeys.VIEW)) {
String data = expandoValueLocalService.getData(
companyId, className, tableName, columnName, classPK,
StringPool.BLANK);
if (Validator.isNotNull(data)) {
{data:".concat(data).concat("}if (!data.startsWith(StringPool.OPEN_CURLY_BRACE)) {
data = "
");
}
return JSONFactoryUtil.createJSONObject(data);
{ return null; }}
else
}
{ return null; }else
}
ExpandoColumn info is available. So according to the column type the data could be retrieved accordingly.
The building of the json string should be built accordingly.
And void values should be handled right.