aspose file tools*
The moose likes JForum and the fly likes Bug fix for deleting posts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JForum
Bookmark "Bug fix for deleting posts" Watch "Bug fix for deleting posts" New topic
Author

Bug fix for deleting posts

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi Rafael,
The 2.0.2 version has a bug on deleting more than 2 posts of 1 topic. It works well if I delete post from the last to the first. But if I delete from the first one. Then it will show a post not found error. According to your post http://www.coderanch.com/t/574454 , the code lack the check of setFirstPostId() and getMinPostId() in TopicModel.java.
I have fixed it up. Here is my work around.

:arrow: In net/jforum/model/TopicModel.java add two method declaraions

:arrow: In net/jforum/drivers/generic/TopicModel.java add two method implementations:

:arrow: in net/jforum/view/PostAction.java modify the delete() method:

:arrow: add two sql script to WEB-INF/classes/config/database/generic_queries.sql

That's all. Add this fix to the CVS please.
[originally posted on jforum.net by andowson]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Ok.. looks reasonable.
I'll put some new buttons in the end of the page ( as phpbb does ) for topic moving, deleting etc..

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Thanks, I added the code to cvs.

Now, here is a conceptual question: I was thinking of removing the entire topic when the first message was deleted. It has pros and cons. What do you think?

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi Rafael,
In my opinion, removing the entire topic when the first message was deleted this function could be assign to the forum administrator. Then he/she could clean up a thread more quickly and easily.

And for normal users, they should be restricted to only delete his posts.

Sometimes, there could be some good idea follow up the first post. For example, at the first, one guy say that how about have a web mail integration with private message in this forum. Then we could send private message through email or just leave it at the forum. In the following up discussion, there could be someone proposes a way to implement it or more improved idea, ex. integrate with SMS, maybe has commercial potential. If the first guy delete his post to keep his idea privately. Then the following posts should be kept. Maybe we cound just delete the text of his posts or just show "Post is deleted" on the original position. And the reader would know that there used to be a (first) post, but later deleted.

So, I suggest you implement them in two seperate button, like a deletePost and deleteTopic. Only admin user can use deleteTopic.
[originally posted on jforum.net by andowson]
 
 
subject: Bug fix for deleting posts