Skip to content

Commit 55d6c84

Browse files
fix(Nav) Nav forces PageMode Live which had side effects dotCMS#32182 (dotCMS#32185)
Every time we do `PageMode.setPageMode(request, PageMode.LIVE);` We need to consider that this will have an impact on other areas of the application that depend of the value in session I introduced this version `PageMode.setPageMode(request, PageMode.LIVE, false);` that sets the attribute at request level and does not disrupt further behavior
1 parent ab3b858 commit 55d6c84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dotCMS/src/main/java/com/dotcms/graphql/datafetcher/NavigationDataFetcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public Map<String, Object> get(DataFetchingEnvironment environment) throws Excep
5656

5757
final String path = (!uri.startsWith(StringPool.FORWARD_SLASH)) ? StringPool.FORWARD_SLASH + uri : uri;
5858
//Force NavTool to behave as Live when rendering items
59-
PageMode.setPageMode(request, PageMode.LIVE);
59+
PageMode.setPageMode(request, PageMode.LIVE, false);
6060
final NavTool tool = new NavTool();
6161
tool.init(ctx);
6262
final NavResult nav = tool.getNav(path, languageId);

dotCMS/src/main/java/com/dotcms/rest/api/v1/page/NavResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public final Response loadJson(@Context final HttpServletRequest request, @Conte
119119

120120
final String path = (!uri.startsWith("/")) ? "/" + uri : uri;
121121
//Force NavTool to behave as Live when rendering items
122-
PageMode.setPageMode(request, PageMode.LIVE);
122+
PageMode.setPageMode(request, PageMode.LIVE, false);
123123
final NavTool tool = new NavTool();
124124
tool.init(ctx);
125125
final NavResult nav = tool.getNav(path, langId);

0 commit comments

Comments
 (0)