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

NullPointerException when using Forms evaluate-context API

    Details

      Description

      Description
      NullPointerException is occurring when the user tries to evaluate the form's context using the Form API.

      Steps to Reproduce

      1. Go to Content -> Forms
      2. Create a new Form
      3. Add a field (can be anyone)
      4. Save the form
      5. Check the ID from your created forms (formId)
      6. Make a POST Request to Form API to obtain the context (/o/headless-form/v1.0/forms/{formId}/evaluate-context) 

      Expected Result
      Returns form context object in JSON format.

      Actual Result
      Return an error message :

      {  "status""INTERNAL_SERVER_ERROR"}
      

      NullPointerException on the console: 

      2020-05-15 17:07:32.132 ERROR [http-nio-8080-exec-10][ExceptionMapper:31] java.lang.NullPointerException2020-05-15 17:07:32.132 ERROR [http-nio-8080-exec-10][ExceptionMapper:31] java.lang.NullPointerExceptionjava.lang.NullPointerException at com.liferay.dynamic.data.mapping.form.renderer.internal.util.DDMFormTemplateContextFactoryUtil.getPathThemeImages(DDMFormTemplateContextFactoryUtil.java:34) at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormFieldTemplateContextFactory.setDDMFormFieldTemplateContextPathThemeImages(DDMFormFieldTemplateContextFactory.java:493) at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormFieldTemplateContextFactory.setProperties(DDMFormFieldTemplateContextFactory.java:723) at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormFieldTemplateContextFactory.createDDMFormFieldTemplateContext(DDMFormFieldTemplateContextFactory.java:154) at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormFieldTemplateContextFactory.createDDMFormFieldTemplateContexts(DDMFormFieldTemplateContextFactory.java:201) at com.liferay.dynamic.data.mapping.form.renderer.internal.DDMFormFieldTemplateContextFactory.create(DDMFormFieldTemplateContextFactory.java:74)
      

       

      Reproduced In
      7.2.x: 49e1b1cf5d7cf7660fe2081fbba0fd6e4ababb03

        Attachments

          Activity

            People

            Assignee:
            guilherme.freire Guilherme Freire (Inactive)
            Reporter:
            marcela.cunha Marcela Cunha
            Participants of an Issue:
            Recent user:
            Guilherme Freire (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              42 weeks ago

                Packages

                Version Package
                7.2.10 DXP FP6
                7.2.X