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

LayoutLocalServiceImpl.getLayoutChildLayouts method is not working correct in case of having Staging with Page Versioning. In 7.0.x, this causes page name translation failures in navigation bar.



      In 7.0.x version, page name translations are not displayed in navigation bar in case of having Staging enabled with Page Versioning.

      Root cause of the issue:
      LayoutLocalServiceImpl.getLayoutChildLayouts is not wrapped by LayoutLocalServiceStagingAdvice, so calls to Layout.getName() method are not redirected to LayoutRevision.getName() by LayoutStagingHandler proxy.

      7.1.x and master
      Due to some logic changes in navigation bar, bug is not reproduced from user interface.

      But bug can be reproduced programmatically if you call LayoutLocalServiceImpl.getLayoutChildLayouts method.

      Steps to Reproduce 7.0.x

      1. Create a site
      2. Activate local staging with Page variations enabled
      3. Create a page called "Page1"
      4. Create other page called "Page2" as a child of "Page1"
      5. Add a translation in Spanish of both page names:
        • Page1 => Página1
        • Page2 => Página2
      6. Open Page2 in Spanish, adding "/es/" to URL before "/web/"
      7. Check navigation bar entries:
        • Expected behavior: Page2 is displayed as "Página2"
        • Wrong behavior: Page2 is displayed as "Page2"

      Steps to Reproduce 7.1.x and master

      1. Follow steps 1 to 5 of previous 7.0.x section
      2. Get "plid" identifier of Page1, you can get it executing following SQL:
        select * from Layout where name like '%Page1%' and groupId = <groupId of staging site>
      3. Execute following groovy script from control panel. Set Plid of Page1 in first line.
        def plid = INSERT_HERE_PLID_OF_PAGE1;
        import com.liferay.portal.kernel.service.*;
        import com.liferay.portal.kernel.util.*;
        import java.util.*;
        def layout = LayoutLocalServiceUtil.fetchLayout(plid);
        def layoutSet = LayoutSetLocalServiceUtil.fetchLayoutSet(layout.getGroupId(), layout.isPrivateLayout())
        def map = LayoutLocalServiceUtil.getLayoutChildLayouts(layoutSet,Collections.singletonList(layout));
        for (def list2 : map.values()) {
           for (def layout2 : list2) {
        • Expected behavior: Script output is "Página2"
        • Wrong behavior: Script output is "Page2"


          Issue Links



              • Assignee:
                summer.zhang Summer Zhang
                jorge.diaz Jorge Diaz
                Participants of an Issue:
                Recent user:
                Brian Wulbern
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Days since last comment:
                  1 year, 38 weeks, 1 day ago


                  Version Package
                  7.0.0 DXP FP59
                  7.0.0 DXP SP9
                  7.1.10 DXP FP3
                  7.1.1 CE GA2