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

Blank versions of pages with no approved drafts appear in the navigation menu after being published through staging



      Any content pages with no approved drafts are hidden from the navigation menu (though they can still be visited by accessing the page URL directly, in which case a blank page will be displayed).

      However, in 7.2, if a staging publication process is performed, the behavior is incorrect. On the Live Site's navigation menu, pages with no approved drafts will be visible.

      This is because 7.2 uses the "publishDate" field of the Layout to determine whether or not the page has had any approved drafts. However, the "publishDate" field is overloaded, as it is used to track not only the draft approval timestamp but also the staging publication timestamp. In this case, it has been set to the staging publication timestamp, leading Liferay to falsely believe that there is an approved draft and thus it should be shown in the navigation menu.

      In master and 7.3, this is fixed by Liferay checking the "published" typeSettings property of the draft page. If the draft page has not had its "published" typeSettings property set, then we know that the page has never been published so we will hide it from the navigation menu.

      This code was added in LPS-107664. However, LPS-107664 is a Technical Task ticket, so it cannot be backported. But we can do a partial backport of it to bring the relevant code to 7.2 to fix this bug.

      Steps to Reproduce
      1. While logged in as an admin, create two sites, TestSite1 and TestSite2
      2. On TestSite1, create two content pages, Page1 and Page2, adding a Heading fragment to both (do not click "publish" after doing so, as we want to leave these in a draft status)
      3. In Site Admin > Site Builder > Pages, select ⠇> Approve Draft for Page1 (leaving Page2 as-is)
      4. Log out as the admin, then navigate to TestSite1 and observe the pages currently present in the navigation menu (it should only show Page1)
      5. Log back in as the admin, navigate to the staging version of TestSite2, then turn on staging using the default configurations
      6. Perform steps 2-3 again on TestSite2
      7. Navigate to Site Admin > Publishing > Staging, then click + > Publish to Live using the default settings (which includes both Page1 and Page2)
      8. Log out and navigate to the live TestSite2
      Expected Result: The live site's navigation menu would only include Page1, as was the case in TestSite1, as Page2 has not had the "publish" button clicked on its page and its draft was not approved
      Actual Result: Page1 and Page2 can be observed on TestSite2 (though there is no content listed on Page2), which is inconsistent with what was observed on TestSite1.


          Issue Links



              joyce.wang Joyce Wang
              michael.bowerman Michael Bowerman
              Participants of an Issue:
              Recent user:
              Gábor Lovas
              Engineering Assignee:
              Michael Bowerman
              0 Vote for this issue
              0 Start watching this issue


                Days since last comment:
                6 weeks, 5 days ago


                  Version Package