Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Delete the only topic post -> got a "dead" topic [DONE]

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yep, reloading forum in tomcat manager did help.

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]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, I know.. we must have some tool to reload / restart / yada yada yada stuff.. But for now, the priorities are other ;)

Rafael
[originally posted on jforum.net by Rafael Steil]
 
reply
    Bookmark Topic Watch Topic
  • New Topic