Skip to content
Permalink
Browse files

LPS-93018 Use draft layout instance for the edit mode to avoid unnece…

…ssary redirect
  • Loading branch information...
pavel-savinov authored and brianchandotcom committed Mar 29, 2019
1 parent d1d007f commit b98cbb21da9517fe2fb30fa7dfe2b530edeaf406
@@ -128,10 +128,14 @@ protected String getRedirectURL(
Layout layout = _layoutLocalService.getLayout(
layoutPageTemplateEntry.getPlid());

Layout draftLayout = _layoutLocalService.fetchLayout(
_portal.getClassNameId(Layout.class), layout.getPlid());

ThemeDisplay themeDisplay = (ThemeDisplay)actionRequest.getAttribute(
WebKeys.THEME_DISPLAY);

String layoutFullURL = _portal.getLayoutFullURL(layout, themeDisplay);
String layoutFullURL = _portal.getLayoutFullURL(
draftLayout, themeDisplay);

layoutFullURL = _http.setParameter(
layoutFullURL, "p_l_mode", Constants.EDIT);
@@ -126,8 +126,11 @@ public String getHref() {
Layout layout = LayoutLocalServiceUtil.fetchLayout(
_layoutPageTemplateEntry.getPlid());

Layout draftLayout = LayoutLocalServiceUtil.fetchLayout(
PortalUtil.getClassNameId(Layout.class), layout.getPlid());

String layoutFullURL = PortalUtil.getLayoutFullURL(
layout, _themeDisplay);
draftLayout, _themeDisplay);

layoutFullURL = HttpUtil.setParameter(
layoutFullURL, "p_l_mode", Constants.EDIT);
@@ -118,8 +118,11 @@ public String getHref() {
Layout layout = LayoutLocalServiceUtil.getLayout(
_layoutPageTemplateEntry.getPlid());

Layout draftLayout = LayoutLocalServiceUtil.fetchLayout(
PortalUtil.getClassNameId(Layout.class), layout.getPlid());

String layoutFullURL = PortalUtil.getLayoutFullURL(
layout, themeDisplay);
draftLayout, themeDisplay);

layoutFullURL = HttpUtil.setParameter(
layoutFullURL, "p_l_mode", Constants.EDIT);

0 comments on commit b98cbb2

Please sign in to comment.
You can’t perform that action at this time.