Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-50830

Can not get String array from Expandovalue with "Group of Text Values" in case of Custom Fields for DM

    Details

      Description

      === Steps to reproduce
      1.) Create a custom field ("test_document") of type Group of strings on Documents and Media Document (Control Panel --> Custom Fields --> Documents and Media Document --> Add Custom Field with type 'Group of Text Values')

      2.) Add a file to Documents and Media.
      3.) Fill the area under Expandovalue field with multiple values separated by new lines.
      4.) Query the expando value, one way is to do it with a Groovy Script (Control Panel --> Server Administration --> Script)
      5.) Choose the language Groovy and enter the following text:

      import com.liferay.portlet.expando.model.ExpandoValue;
      import com.liferay.portlet.documentlibrary.model.DLFileEntry;
      import com.liferay.portlet.expando.model.ExpandoTableConstants;
      import com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil;
      import java.util.Arrays;
      
      companyId=10154 //get from DB
      classPK=10705 //get from DB
      
      expandoValue = ExpandoValueLocalServiceUtil.getData(companyId,DLFileEntry.class.getName(), ExpandoTableConstants.DEFAULT_TABLE_NAME, "test_document",classPK,new String [3]);
      
      out.println(Arrays.toString(expandoValue));
      out.println('length:' + expandoValue.length);
      

      === Background
      LPS-44195 addressed the same issue, though, its solution is incomplete:

      The conversion from the request params (serializable values from the HttpServletRequest) are handled in PortalImpl#Serializable getExpandoValue(....) methods.

      This method name is overloaded:
      1-

      	@Override
      	public Serializable getExpandoValue(
      			PortletRequest portletRequest, String name, int type,
      			String displayType)
      		throws PortalException, SystemException {...}
      

      2-

      	@Override
      	public Serializable getExpandoValue(
      			UploadPortletRequest uploadPortletRequest, String name, int type,
      			String displayType)
      		throws PortalException, SystemException {...}
      

      LPS-44195 fixed the issue in the 1st method only.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 44 weeks, 5 days ago

                  Packages

                  Version Package
                  6.2.3 CE GA4
                  6.2.X EE
                  7.0.0 M3