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

RenderedContentURL value incorrectly generated in 72x




      Please note, this issue does not affect 7.3.x and above due to LPS-104292.  In 72x, LPS-104292 included an additional commit which changed the template fetching from templateKey to templateId.  However, with the inclusion of LPS-117229, when populating the renderedContentURL, we now use the templateKey, leading to bad URL generation in 72x.

      Steps to reproduce:

      1. Start 72x (issue is non-existent in 73x and above due to LPS-104292 not using the templateId in these versions).
      2. Create a new Web Content Structure with a text field.
      3. Create a new template for the Structure and include the text field in the display.
      4. Create a new Web Content based off the structure created in step 2.  Add "test" to the text field.
      5. Run the following cURL command in your console, replacing "{siteId}" with the articles groupId and "{key}" with the articleId
       curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/sites/{siteId}/structured-contents/by-key/{key}' -u 'test@liferay.com:test'
      1. The command should return a large amount of text, and towards the bottom being the "renderedContentURL" value.
      2. Place this renderedContentURL value into the following cURL command:
      curl -X 'GET' 'http://localhost:8080/o/headless-delivery/v1.0/structured-contents/{journalArticleResourcePrimKey}/rendered-content/{templateKey}' -u 'test@liferay.com:test'
      1. Run the cURL command.  Confirm the command does not work.
      2. To confirm this is a case of incorrect renderedContentURL generation, swap the "{templateKey}" value for the templateId of the template created in step 3.  This returns the "test" text properly.

      Expected Results: At step 8, the command returns the "test" text added in step 4, because the renderedContentURL value is populated correctly.

      Actual Results: The command returns "status" : "INTERNAL_SERVER_ERROR".  This is because the renderedContentURL is returning the templateKey instead of the templateId.

      Reproduced in master: No, not reproducible because the templateKey is used

      reproduced in 72x: yes 16b531ee05ccef2c6f3b01cdd346a6094d78a013




            brian.chan Brian Chan
            christopher.kian Christopher Kian
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Engineering Assignee:
            Christopher Kian
            0 Vote for this issue
            0 Start watching this issue


              Days since last comment:
              16 weeks, 1 day ago


                Version Package
                7.2.10 DXP FP11
       DXP SP4