JorgeFerrer/liferay-portal — pull request #124 by KocsisDaniel (2013-01-28 14:26:08+00:00)
Title: LPS-31117 Add scope group to live as well when staging active

Hi Jorge,

here is the fix, which contains only the scope group addition related changes. And as you requested I created a list about the preference related issues, which leads to errors in scoping and in staging in general.

* Case \#1 (when do the scoping neither the layout nor the portlet on it exists on the live)
- create site
- turn on staging but turn it off for Bookmarks
- add layout 'layout1'
- put bookmarks portlet into it
- add folder with name: default scope
- scope the portlet to the current page --> still display the default folder
- resolution: publish the layout

* Case \#2 (when do the scoping layout exists on the live but portlet has not been there):
- add 'layout2'
- publish
- add Bokkmarks portlet to the page
- scope the portlet to the current page --> still the default folder is there however the portlet title shows it is scoped.
- resolution: publish the layout

* Case \#3 (when do the scoping layout&portlet exist on live but preference has not been published):
- add layout 'layout3'
- add bookmarks portlet
- publish the page
- scope the portlet to the current layout --> portlet still shows content from default scope, it happens because we modify the staged portlet preference when configure the portlet, but otherwise the portlet uses the live instance preference, which is not scoped yet until the publish)
- resolution: publish the layout

* Case \#4:
- try to play with portlet setups after the last step of each step like with 'Show Search' option
- turn it off and save
- it is still there on the staging site however it is turned off on the live page (we are editing the live preference from staging site)

I am pretty sure the problem is caused by the PortalImpl.getScopeGroupId() method we use in many places like render_portlet.jsp to get portlet preferences or any other place where we need an ownerId/groupId to get the portlet preference. As you can see we already tried to address this issue in LPS-23877 but it seems it was not enough or complete.

thanks,
Daniel