Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Editing messages OK

  • Loading branch information...
commit f4814b895e14cb37092f220fa7545a17cf74d84f 1 parent 49abe09
Rafael Steil authored
View
13 src/main/java/net/jforum/controllers/PostController.java
@@ -89,14 +89,13 @@ public void delete(int postId) {
/**
* Saves an existing message
* @param post the message to save
- * @param options the formatting options
+ * @param postOptions the formatting options
*/
@SecurityConstraint(value = ChangePostRule.class)
- public void editSave( Post post, PostFormOptions options,
- List<PollOption> pollOptions, ModerationLog moderationLog) {
+ public void editSave( Post post, PostFormOptions postOptions, List<PollOption> pollOptions, ModerationLog moderationLog) {
- ActionUtils.definePostOptions(post, options);
- post.getTopic().setType(options.getTopicType());
+ ActionUtils.definePostOptions(post, postOptions);
+ post.getTopic().setType(postOptions.getTopicType());
Post currentPost = this.postRepository.get(post.getId());
List<AttachedFile> attachments = new ArrayList<AttachedFile>();
@@ -117,7 +116,6 @@ public void editSave( Post post, PostFormOptions options,
}
this.postService.update(post, roleManager.getCanCreateStickyAnnouncementTopics(), pollOptions, attachments, moderationLog);
- //TODO pass zero and true?
this.result.redirectTo(TopicController.class).list(post.getTopic().getId(), 0, true);
}
@@ -135,9 +133,6 @@ public void edit(int postId) {
this.result.include("forum", post.getTopic().getForum());
this.result.include("smilies", this.smilieRepository.getAllSmilies());
- //this.viewService.renderView(Domain.TOPICS, Actions.ADD);
-
- //TODO pass what to add method?
this.result.forwardTo(TopicController.class).add(0);
}
View
10 src/main/java/net/jforum/controllers/TopicController.java
@@ -220,8 +220,14 @@ public void preview(String message, PostFormOptions options) {
public void add(int forumId) {
Forum forum = this.forumRepository.get(forumId);
- this.result.include("forum", forum);
- this.result.include("post", new Post());
+ if (!result.included().containsKey("forum")) {
+ this.result.include("forum", forum);
+ }
+
+ if (!result.included().containsKey("post")) {
+ this.result.include("post", new Post());
+ }
+
this.result.include("isNewTopic", true);
this.result.include("smilies", this.smilieRepository.getAllSmilies());
}
Please sign in to comment.
Something went wrong with that request. Please try again.