Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 4 years ago

#6484 closed defect (bug) (fixed)

If post/activity comment sync is on, activity comment is never deleted when corresponding post comment is.

Reported by: imath Owned by: imath
Milestone: 2.4 Priority: high
Severity: major Version: 2.0
Component: Blogs Keywords: has-patch commit
Cc:

Description

I had almost finished building a first patch for #6482 when i discovered something very problematic with the "post comment sync activity comment feature".

having ! bp_disable_blogforum_comments() (in other words comment sync is on), let's say i create a post, i comment it, then i add a reply to this comment.
If i trash the parent comment, i still have the activity reply and the activity comment is now a spam. Which is the way it's built..

Now, let's say i finally choose to delete permanently the parent comment from the Administration > Comments > Trash view. The post comment is deleted, but the activity comment is still a spam and the activity reply is not deleted (neither the corresponding comment).

In this scenario, i saw other annoying side effects.. But it looks like if you trash a post comment, then delete it permanently, the corresponding activity comment is never deleted but remains a spam.

I'm not sure but i think it's there since the introduction of the feature.

The attached patch is fixing the issue. But i think there might be a need for a repair tool to remove spammed activity comments having no corresponding post comment.

Attachments (2)

6484.patch (493 bytes) - added by imath 5 years ago.
6484.unit-test.patch (2.5 KB) - added by r-a-y 4 years ago.

Download all attachments as: .zip

Change History (6)

@imath
5 years ago

#1 @r-a-y
4 years ago

Good catch, imath!

But i think there might be a need for a repair tool to remove spammed activity comments having no corresponding post comment.

Maybe we should do something similar to wp_scheduled_delete(). Delete activity spam after the days set in the EMPTY_TRASH_DAYS constant.

#2 @imath
4 years ago

r-a-y in this part you are using the spam column to fake the trash. I a comment is untrash you unspam :)

So i'd say why not but we would need to compare activity meta with comment meta before deleting.

#3 @r-a-y
4 years ago

  • Keywords commit added

Let's commit this.

Thanks imath for uncovering! We'll worry about the trash stuff in another ticket.

Last edited 4 years ago by r-a-y (previous) (diff)

#4 @imath
4 years ago

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

In 10034:

Activity comments/Post comments sync: Make sure the activity comment is permanently deleted when the corresponding post comment has been permanently deleted.

Props r-a-y

Fixes #6484

Note: See TracTickets for help on using tickets.