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

Mapping a custom item type fails with NPE if returned InfoForm does not have a label

    Details

      Description

      Steps to reproduce:

      1. Develop an InfoItemFormProvider for a custom item type (see for example AssetCategoryInfoItemFormProvider.java)
      2. Display an item for the custom type in a page, for example through a Collection Display that uses a custom InfoListProvider that returns items of that type
      3. Add a heading or paragraph and try to map its editable-text to a field.

      Expected result

      The available fields (title, description and vocabulary) are shown.

      Actual result

      No fields are available and the following exception is shown in the logs:

       

      java.lang.NullPointerExceptionjava.lang.NullPointerException 
      at com.liferay.info.form.InfoForm.getLabel(InfoForm.java:139) 
      at com.liferay.layout.content.page.editor.web.internal.portlet.action.GetCollectionMappingFieldsMVCResourceCommand.doServeResource(GetCollectionMappingFieldsMVCResourceCommand.java:118) 
      at com.liferay.portal.kernel.portlet.bridges.mvc.BaseMVCResourceCommand.serveResource(BaseMVCResourceCommand.java:41) 
      at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callResourceMethod(MVCPortlet.java:419)
      ...

       

        Attachments

          Activity

            People

            Assignee:
            yang.cao Yang Cao
            Reporter:
            jorge.ferrer Jorge Ferrer (Inactive)
            Participants of an Issue:
            Recent user:
            Jason Pince
            Engineering Assignee:
            Eudaldo Alonso
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              1 year, 3 weeks, 1 day ago

                Packages

                Version Package
                7.3.5 CE GA6
                7.3.10 DXP GA1
                Master