Skip to content

Commit

Permalink
Revert "LPS-140318 Use the layoutPlid from the request to update the …
Browse files Browse the repository at this point in the history
…current layout portletPreferences on demand."

This reverts commit 8bdd23b.
  • Loading branch information
ruben-pulido authored and brianchandotcom committed Oct 22, 2021
1 parent e480f23 commit dd9364f
Showing 1 changed file with 9 additions and 13 deletions.
Expand Up @@ -43,7 +43,6 @@
import com.liferay.portal.kernel.service.PortletPreferencesLocalService;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ListUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PortletKeys;
import com.liferay.portal.kernel.util.ResourceBundleUtil;
import com.liferay.portal.kernel.util.StringUtil;
Expand Down Expand Up @@ -199,13 +198,9 @@ else if (processedPortletIds.contains(portletName) ||

String defaultPreferences = StringPool.BLANK;

long plid = ParamUtil.getLong(
fragmentEntryProcessorContext.getHttpServletRequest(),
"p_l_id");

if (originalFragmentEntryLink != null) {
defaultPreferences = _getPreferences(
plid, portletName, originalFragmentEntryLink, id,
portletName, originalFragmentEntryLink, id,
StringPool.BLANK);
}
else {
Expand All @@ -217,8 +212,7 @@ else if (processedPortletIds.contains(portletName) ||
fragmentEntryProcessorContext.getHttpServletResponse(),
portletName, instanceId,
_getPreferences(
plid, portletName, fragmentEntryLink, id,
defaultPreferences));
portletName, fragmentEntryLink, id, defaultPreferences));

Element portletElement = new Element("div");

Expand Down Expand Up @@ -321,8 +315,8 @@ private String _getPortletName(String tagName) {
}

private String _getPreferences(
long plid, String portletName, FragmentEntryLink fragmentEntryLink,
String id, String defaultPreferences)
String portletName, FragmentEntryLink fragmentEntryLink, String id,
String defaultPreferences)
throws PortalException {

String defaultPortletId = _getPortletId(
Expand Down Expand Up @@ -356,7 +350,7 @@ private String _getPreferences(
PortletPreferencesFactoryUtil.toXML(jxPortletPreferences));

_updateLayoutPortletSetup(
plid, portletPreferencesList, jxPortletPreferences);
portletPreferencesList, jxPortletPreferences);
}

Document preferencesDocument = _getDocument(
Expand Down Expand Up @@ -402,15 +396,17 @@ private String _renderWidgetHTML(
}

private void _updateLayoutPortletSetup(
long layoutPlid,
List<com.liferay.portal.kernel.model.PortletPreferences>
portletPreferencesList,
PortletPreferences jxPortletPreferences) {

long plid = 0;

if (jxPortletPreferences instanceof PortletPreferencesImpl) {
plid = layoutPlid;
PortletPreferencesImpl portletPreferencesImpl =
(PortletPreferencesImpl)jxPortletPreferences;

plid = portletPreferencesImpl.getPlid();
}

String portletPreferencesXML = PortletPreferencesFactoryUtil.toXML(
Expand Down

0 comments on commit dd9364f

Please sign in to comment.