Skip to:

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#1150 closed defect (fixed)

Undeleting entire topic also undeletes posts from other topics

Reported by: scribu Owned by:
Milestone: 1.0.3 Priority: highest
Severity: blocker Version: 1.0.2
Component: General - Administration Keywords:
Cc: scribu@…


On bbPress 1.0.1, if you go to a topic with a single post and delete that post, you are not redirected to the main page.

Additionally, if after deleting that single post, you also delete the topic (which is empty), all previously deleted posts from that topic are undeleted.

Change History (15)

#1 @scribu
9 years ago

  • Cc scribu@… added

#2 @scribu
9 years ago

  • Milestone changed from 1.0.1 to 1.1

#3 @kevinjohngallagher
8 years ago

  • Milestone changed from 1.1 to 1.5
  • Priority changed from normal to high

#4 @GautamGupta
8 years ago

  • Milestone changed from 1.5 to 1.1
  • Severity changed from normal to critical

This is a serious bug. Deleting a topic without any posts undeletes all the posts (even of other topics).

#5 @GautamGupta
8 years ago

  • Keywords dev-review added
  • Milestone changed from 1.1 to 1.0.3
  • Priority changed from high to highest
  • Version changed from 1.0 to 1.0.2

This bug could become severe when a moderator does this and eventually leaves all the deleted posts undeleted. Also, if the forum is full of spam, then it would get everywhere (as no post is deleted permanently in bbPress). Furthermore, this would also make the end-user leave bbPress if he/she doesn't have a backup.

#6 @GautamGupta
8 years ago

One way to fix this is to add a new_action parameter (0 for undeleted and 1 for deleted), and then verify that with the old status in bb-admin/delete-topic.php. But that wont fix the root cause, so we would need to dig deeper into bb_delete_topic and BB_QUERY to find out what's happening and why posts *from other topics* get undeleted.

#7 @GautamGupta
8 years ago

  • Keywords dev-review removed
  • Severity changed from critical to blocker
  • Summary changed from Redirect after deleting single post in topic to Undeleting entire topic also undeletes posts from other topics

More info: When you undelete any topic, regardless the topic has any number of posts, or following any "steps to reproduce", posts from other topics also get undeleted.

Related: #1090, the forum would be having so many deleted posts that while undeleting entire topic, server would result into a 500 internal server error as it could not handle undeleting so many posts at once.

#8 @chrishajer
8 years ago

Why not hide the function (link) to delete a single post when there is only one visible post on a topic? That way, there is apparently no way to delete the post (which we are trying to discourage) and you have to delete the whole topic.

Is there ever a case where you want to delete the only post on a topic and retain the topic? With all the downsides of deleting the lone reply on a topic (as described by scribu), I think it would be better to just encourage deleting the whole topic. I've trained myself to do it that way already.

#9 @scribu
8 years ago

chrishajer, that sounds like a good workaround.

#10 @GautamGupta
8 years ago

The problem is not that which scribu has reported, a big problem lies underneath it and that is - if you have deleted posts from other topics, and you undelete any topic, then deleted posts from other topics also get undeleted which is a serious issue as described in my previous replies.

#11 @chrishajer
8 years ago

I guess it's two problems then:

  1. Fix the bug where undeleting a topic undeletes posts on other topics (that part seems like a bug)
  1. Make it so you can't delete the only post on a topic, leaving an empty topic (my suggestion to fix that was in the previous comment.)

If this should be two tickets, please open another and we can fix them separately.

#12 @mdawaffe
8 years ago

(In [2423]) if the only post of a topic is deleted, redirect to topic_url?view=all. See #1150

#13 @mdawaffe
8 years ago

(In [2424]) when undeleting a topic, only undelete that topic's posts, not all posts. See #1150

#14 @mdawaffe
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

I believe everything on this ticket has been fixed. If there are still related bugs, please open a new ticket (referencing this one).

Problem 1: If you delete the only post in a topic, you either get redirected to a "this topic does not exist" link (if no JS), or see an empty topic (if JS).

Fixed. We now redirect to the view=all view of the topic after deleteting the only post, both for JS and non JS interfaces.

The topic is now (and always was) getting deleted when the only post was deleted, the UI was just a little wonky.

Problem 2: Undeleting a topic undeletes all posts on any topic.

Fixed. It looks like an API change in the get_thread_where filter. I'll be patching a couple other places this bites us momentarily.

#15 @GautamGupta
8 years ago

  • Keywords needs-patch removed

Cool, I'll test it.

Note: See TracTickets for help on using tickets.