Affects Version/s: 7.0.X, 7.1.X, Master
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
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
– 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
IDs will be different
IDs are the same
intellij-breakpoint.png shows the "breakpoint" step, in which _layout inside both layout and clonedLayout have the same [email protected], when they should be different in a deep copy.
Reproduced - 524ea95f89e2a95b822e7b4fddbe5e0e622d2282
Reproduced - b0402fe5d64f9f9cf6c3974e7a37a393abfcf6bd
Reproduced - aae291936df55586376bd519c72332ba921f23d5