-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 6.1.20 EE GA2, 6.1.30 EE GA3, 7.0.0 M3
-
Fix Version/s: 6.1.X EE, 6.2.2 CE GA3 , 6.2.X EE, 7.0.0 M1
-
Component/s: Portal Services, Portal Services > Expando
-
Branch Version/s:6.2.x, 6.1.x
-
Backported to Branch:Committed
-
Story Points:7
-
Fix Priority:3
-
Git Pull Request:
When getting "Group of Text" type of ExpandoValue, I can not get a well-filled array of String, just a 1 length String array, in which the 0th elementh contains the all the values in one String.
EDITED:
I changed the string literal in the groovy script from dimension to length, because "dimension" can be misleading.
steps to reproduce
- create a custom field (let the key name : "testkey") for Document Folders, type: Group of Text Values
- create a Document Folder, fill in the "testkey" field with value of "A[ENTER]B[ENTER]C". (Where [ENTER] means press the Enter key)
- check the "expandovalue" table, there should be a row there, where _data is similar to A B C
- note the classPK and companyID values.
- use the groovy script to get this field value, with the appropriate classPK and companyID values.
- go to Server Administration, scripts
- set Javascript to Groovy
- copy paste the groovy script here into the textarea field
- click on Execute
expected behaviour
The script output should be:
[A, B, C] length:3
experienced behaviour
The script output is
[A, B, C] length:1
the groovy script for testing
change classPK and companyID !
import com.liferay.portlet.expando.model.ExpandoValue; import com.liferay.portlet.documentlibrary.model.DLFolder; import com.liferay.portlet.expando.model.ExpandoTableConstants; import com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil; import java.util.Arrays; classPK = 10469; companyID = 10156; expandoValue = ExpandoValueLocalServiceUtil.getData(companyID,DLFolder.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "testkey",classPK,new String [0]); println(Arrays.toString(expandoValue)); println('length:' + expandoValue.length);
- relates
-
LPS-44754 If the form is broken custom fields may result in NPE
- Closed
-
LPE-11415 Expando value of type "Group of Text Values" is not properly parsed into a string array
-
- Closed
-
- Testing discovered
-
LPS-50830 Can not get String array from Expandovalue with "Group of Text Values" in case of Custom Fields for DM
- Closed