[MGNLFORUM-237] Deleting a forum and creating a new one with same name throws exception Created: 19/Feb/14 Updated: 24/Feb/14 Resolved: 20/Feb/14 |
|
| Status: | Closed |
| Project: | Forum (closed) |
| Component/s: | None |
| Affects Version/s: | 3.3 |
| Fix Version/s: | 3.3 |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Roman Kovařík | Assignee: | Christoph Meier |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Date of First Response: |
| Description |
|
Steps to reproduce:
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException: Role with name forum-1-user already exists. at info.magnolia.module.forum.DefaultForumManager$1.doExec(DefaultForumManager.java:168) at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:414) at info.magnolia.context.MgnlContext$VoidOp.exec(MgnlContext.java:411) at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:385) at info.magnolia.context.MgnlContext.doInSystemContext(MgnlContext.java:371) at info.magnolia.module.forum.DefaultForumManager.createForumRoles(DefaultForumManager.java:154) at info.magnolia.module.forum.DefaultForumManager.createForum(DefaultForumManager.java:145) at info.magnolia.module.forum.app.action.SaveDialogNewForumAction.execute(SaveDialogNewForumAction.java:75) at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:74) ... 110 more Caused by: java.lang.IllegalArgumentException: Role with name forum-1-user already exists. at info.magnolia.cms.security.MgnlRoleManager.validateRoleName(MgnlRoleManager.java:254) at info.magnolia.cms.security.MgnlRoleManager.createRole(MgnlRoleManager.java:98) at info.magnolia.cms.security.MgnlRoleManager.createRole(MgnlRoleManager.java:87) at info.magnolia.module.forum.DefaultForumManager$1.doExec(DefaultForumManager.java:159) ... 118 more |
| Comments |
| Comment by Christoph Meier [ 19/Feb/14 ] |
|
Automatically deleting roles seems risky since user may have references to these roles. This said, the current behaviour is correct. The "not so nice thing" is the error-message which pops up, it says "Action execution failed for action: commit" ... |
| Comment by Roman Kovařík [ 20/Feb/14 ] |
|
In this case, info.magnolia.module.forum.DefaultForumManager.createForumRoles(Content) should check if the role doesn't exists already. |
| Comment by Roman Kovařík [ 20/Feb/14 ] |
|