So, I've opened a (that is, created new) topic with a post. Later, as Admin, I've removed that post (the only post in the topic) with a [x] button from the upper right corner of message. Confirmed that yes, I want to remove the message. The topic was not deleted from the topic list, but if I try to open it, I get an forum error stating that I don't have enough permissions to view that topic. I've clicked on "Open moderation options" in the topic list, checked the "dead" topic and clicked "delete". Confirmation dialog asked me if I'm sure, then I was assured that topic's deleted, but nothing changed.
By the way, how do I remove the topic (with possible posts) using MySQL console? [originally posted on jforum.net by Daniil]
This is a little bug from 3.1. I keep in memory all topics that are showed in the first page of each forum. I forgot to reload the cache when removing a post.
To delete stuff from the mysql console is a little tryck.. Here is the sittuation:
There is some relationship between jforum_topics, jforum_posts and jforum_forums.
:arrow: jforum_topics keep the first and last post id in the topic and the total number of replies. If you delete some post, you must:
1) Decrease the number of the column "topic_replies"
2) Check if the post id is even the same as topic_first_post_id or topic_last_post_id.. If true, then you must update these values as well.
:arrow: If the post you deleted was the only one in the topic, you must also delete the topic.
:arrow: All data from the forums listing page and the first page of each forum are kept in memory. So, you may need to restart tomcat to see the changes in the total number of messages of each forum, for example ( and this is also valid if you delete some topic that is in the first page of the listing ).
I guess is that all.
Rafael [originally posted on jforum.net by Rafael Steil]
And thanks for the explanation about the structure.
BTW, I know sometimes (bugs, server faults, whatever) phpBB's database becomes inconsistent (visible effects are incorrect displayed number of posts, pages and such). It would be cool to make a maintenance program which would fix incorrect information and include it with JForum distro :roll: [originally posted on jforum.net by Daniil]