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

Web content's document field still points to the staging site in live, when there's a circular reference between them

    Details

      Description

      1. Start up a clean portal
      2. Create a new site
      3. Activate local staging
      4. Content & Data ==> Documents and Media ==> Document Types ==> Create a new Document Type with a Web Content field
      5. Create a new document using the new type, upload any file and leave the web content field empty for now
      6. Content & Data ==> Web Contents ==> Structures ==> Create a new structure with a Document field (it's now called Upload field in master version)
      7. Create a simple template, to be able to display the field of the web content: (...) menu on the Structure ==> Manage Templates ==> Add Freemarker template
      8. On the left panel (right on master) of the template editor, click on the Document field to insert its template code (the field is called Upload on master). Save the template.
      9. Create a new web content using the structure, select the previously created document in the field
      10. Go back to Documents and Media and edit the document, select the web content you created and save
      11. Go to Publishing ==> Staging and start a new publish process with the default settings
      12. Go to Live site and in Content & Data ==> Web Contents, preview the published web content

      Expected: the link should point to the document in the Live site, using the live Site ID
      Actual: the link still points to the document in the Staging site: http://localhost:8080/documents/40869/0/Test.pdf/3e88893b-c43b-7a78-86f2-c427a42b98db?t=1632396465999

      Notes:

      • You can check the current live site ID on Configuration ==> Site Settings ==> Site Configuration
      • The issue is similar to LPS-135330 , probably the solution will be something similar too
      • Import starts with the document. As soon as it realizes that it has a reference to a web content, it starts importing it before creating the actual document. When the JournalArticle is imported, its references are not correctly replaced, since the document is not yet created, and its ID mapping is not yet in PortletDataContext
      • Workaround: re-publish only the web content only, so it will point to the document that already exists in Live

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              oziel.souza Oziel Souza
              Reporter:
              vendel.toreki Vendel Töreki
              Participants of an Issue:
              Recent user:
              Lu Liu
              Engineering Assignee:
              Adolfo Pérez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                45 weeks, 4 days ago

                  Packages

                  Version Package
                  7.4.13 DXP GA1
                  7.4.3.4 CE GA4
                  Master