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

LayoutLocalServiceUtil.fetchDefaultLayout() returns the wrong default layout when the page hierarchy has multiple levels

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Duplicate
    • Affects Version/s: 7.1.X, 7.2.X, Master
    • Fix Version/s: None
    • Labels:
    • Fix Priority:
      3

      Description

      Reproduction steps:

      0.) Start a vanilla bundle
      1.) Create a new site
      2.) In the new site create the following page tree:

      • P1(parent) + P1_1(child)
      • P2(parent)

      3.) Drag and drop P1(parent) + P1_1(child) into P2 and open up the page tree.
      4.) Run the following Groovy script:

      import com.liferay.portal.kernel.model.Layout;
      import com.liferay.portal.kernel.service.LayoutLocalServiceUtil;
      long groupId = <<insert Site's ID here>>;
      Layout layout = LayoutLocalServiceUtil.fetchDefaultLayout(groupId, false);
      out.println(layout.getNameCurrentValue());
      

      Actual result: the script's output is 'P1', which is wrong, since P1 is no longer on the top of the page hierarchy
      Expected result: the script should print 'P2' as it is now the first page on the top level of the page hierarchy

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              vendel.toreki Vendel Töreki
              Reporter:
              vendel.toreki Vendel Töreki
              Participants of an Issue:
              Recent user:
              Vendel Töreki
              Engineering Assignee:
              Vendel Töreki
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 16 weeks, 3 days ago

                  Packages

                  Version Package