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

Layout Staging _clone methods use shallow copy instead of deep copy

    Details

      Description

      Description
      When staging/versioning are turned on, a proxy instance is created for the layout and this _clone() method is called. This method calls the constructor LayoutStagingHandler(), which does a shallow copy of layout rather than a deep copy, resulting in unexpected behavior (like LPS-86990).

      This issue also occurs in LayoutSetStagingHandler

      Steps to reproduce
      1. Install 2 bundles of Liferay
      2. Configure the portal-ext.properties so staged server can talk to live server for publishing
      – in both portal-ext.properties

      tunneling.servlet.shared.secret=6162636465666768696a6b6c6d6e6f70
      tunneling.servlet.shared.secret.hex=true
      

      – Change Ports in one bundle to differ from other in tomcat/conf/server.xml
      ex. add 100 to all ports (like 8180)
      3. Set up Liferay site on the staging server to publish remotely to Liferay site on the live server on the live bundle. Be sure to enable page versioning for public pages
      4. On stage server Test Site 1, go to Product menu > Test Site 1 > Build > Pages
      5. Hover over "Welcome", click the "+" to "Add Page"
      6. Click "Link to URL", name page Test
      7. For URL, specify a URL on the "live" server such as "localhost:8180" (address of live server).
      8. In a debugger, set breakpoint at LayoutServiceImpl#2306
      9. Observe unique IDs of clonedLayout, and layout variables

      Expected Results:
      IDs will be different
       Actual Results:
      IDs are the same

      Screenshots

      intellij-breakpoint.png shows the "breakpoint" step, in which _layout inside both layout and clonedLayout have the same LayoutImpl@41764, when they should be different in a deep copy.

      Master
      Reproduced - 524ea95f89e2a95b822e7b4fddbe5e0e622d2282

      Branch
      71x -
      Reproduced - b0402fe5d64f9f9cf6c3974e7a37a393abfcf6bd
      70x -
      Reproduced - aae291936df55586376bd519c72332ba921f23d5

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                beck.liu Beck Liu
                Reporter:
                alfred.sampang Alfred Sampang
                Participants of an Issue:
                Recent user:
                Joyce Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  51 weeks, 5 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP68
                  7.0.X
                  7.1.10 DXP FP5
                  7.1.10.1 SP1
                  7.1.2 CE GA3
                  7.1.X
                  Master