Skip to content

Commit 6722b65

Browse files
committed
## 2.3.34
* fixed #317 switch Context is broken * fixed #326 add Context to Breadcrumb * Issue #327 AbstractController: rename rootCategories to rootProjects (line 77) * Issue #328 AbstractController: rename allCategories to allProjects (line 66) * fixed #329 AbstractController: remove side effects from getContext (line 145, 159) * Issue #330 Add Project to Root Project: preset correct Context
1 parent a0d9ed5 commit 6722b65

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

etc/TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* fixed #326 add Context to Breadcrumb
6666
* Issue #327 AbstractController: rename rootCategories to rootProjects (line 77)
6767
* Issue #328 AbstractController: rename allCategories to allProjects (line 66)
68-
* Issue #329 AbstractController: remove side effects from getContext (line 145, 159)
68+
* fixed #329 AbstractController: remove side effects from getContext (line 145, 159)
6969
* Issue #330 Add Project to Root Project: preset correct Context
7070

7171
## 2.3.35

src/main/java/org/woehlke/simpleworklist/common/domain/AbstractController.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,13 @@ protected UserAccount getUser() {
144144

145145
protected Context getContext(@NotNull final UserSessionBean userSession){
146146
UserAccount thisUser = this.getUser();
147-
//if(userSession == null){
148-
// userSession = new UserSessionBean();
149-
//}
150147
long defaultContextId = thisUser.getDefaultContext().getId();
151-
//userSession.setLastContextId(defaultContextId);
152-
Context context = contextService.findByIdAndUserAccount(userSession.getLastContextId(), thisUser);
153-
//userSession.setLastContextId(context.getId());
154-
//userSession.setUserAccountid(thisUser.getId());
148+
long userSessionLastContextId = userSession.getLastContextId();
149+
long newContextId = userSessionLastContextId;
150+
if(userSessionLastContextId == 0L){
151+
newContextId = defaultContextId;
152+
}
153+
Context context = contextService.findByIdAndUserAccount(newContextId, thisUser);
155154
return context;
156155
}
157156

0 commit comments

Comments
 (0)