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

NullPointerException providing no content fields for a structure with no required fields through APIs

Details

    Description

      When you don't provide content fields in a structured content of a content structure with no required fields, a NullPointerException is thrown when the field has no default value.

      Steps to reproduce:

      1. Create a Web Content Structure with one non-required field and no default value (or use Basic Web Content)
      2. Create a Structured Content through APIs sending a request with only title and contentStructureId
      curl -H "Content-Type: application/json" -X POST "http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-contents" -d "{\"contentStructureId\": {contentStructureId}, \"title\": \"Test Article\"}" -u "[email protected]:test"
      

      Remember to replace the {siteId} in the path and the {contentStructureId} in the body with valid ids in your portal instance

      Result: A 500 Internal Server Error status code is returned and a NullPointerException is logged in the server

      Expected Result: The Structured Content is created successfully and a 200 status code is returned

      Attachments

        Activity

          People

            brian.chan Brian Chan
            javier.dearcos Javier de Arcos Velilla
            Kiyoshi Lee Kiyoshi Lee
            Javier de Arcos Velilla Javier de Arcos Velilla
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 22 weeks, 2 days ago

              Packages

                Version Package
                7.4.3.6 CE GA6
                7.4.13 DXP U2
                7.4.3.7 CE GA7
                7.4.13 DXP U3
                Master