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

headless-delivery/v1.0/content-structures/${structureId}/structured-contents fails with 404 if one version of the journalArticle references a missing folder

    Details

      Description

      When calling to headless-delivery/v1.0/content-structures/${structureId}/structured-contents method below response is shown if there's any exception.

      status": NOT FOUND, 
      "title": "No JournalFolder exist with the primary key XXXX
      

      This could be correct if there's a fatal exception, but in case a webcontent references a journalFolder that doesn't exists, same message is shown.

      In the UI this web content is not shown.

      This content comes from a migration and in those cases exists some inconsistencies. I'll put some steps to reproduce this inconsistency.

      Steps to reproduce.

      1. Go to global site and create a web content structure (S1)
      2. Annotate this structureId, we will need it later (s1-structureId)
      3. Create a new s1 web content (g1 with content "this is a global content")
      4. Go to Liferay site
      5. Create a new folder in webcontent (f1)
      6. Create a new folder in webcontent (f2)
      7. Create a new s1 web content inside f1 (l1 with content "this is a content in liferay site and folder1")
      8. Create a new s1 web content inside f2 (l2 with content "this is a content in liferay site and folder1")
      9. Stop Liferay and delete f2 folder from database.
      10. Start Liferay
      11. with postman make an api call to http://localhost:8080/o/headless-delivery/v1.0/content-structures/${s1-structureId}/structured-contents

      Expected result:
      contents g1 and l1 are returned

      Current result:
      404 Error is returned

      status": NOT FOUND, 
      "title": "No JournalFolder exist with the primary key XXXX
      

        Attachments

          Activity

            People

            Assignee:
            team-frontend-infra Product Team Frontend Infrastructure
            Reporter:
            jorge.garcia Jorge García Jiménez
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Jorge García Jiménez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              13 weeks, 6 days ago

                Packages

                Version Package
                7.3.X
                7.4.13 DXP GA1
                Master