Opened 9 years ago
Closed 9 years ago
#6530 closed defect (bug) (fixed)
Activity items are not created when parent item is not found
Reported by: | needle | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.4 | Priority: | normal |
Severity: | normal | Version: | 2.0 |
Component: | Blogs | Keywords: | has-patch commit |
Cc: |
Description
Cross-posted as a follow-up to #6478.
I have experienced activity items not being created when "Allow activity stream commenting on blog and forum posts" is on. It appears that @r-a-y's observation on #6478 that "Create a new blog post. (This may be the difference.)" is correct.
The reason is that when a new activity item's parent activity item is not found then, instead of falling back to creating an "independent" activity item, no activity item is created at all.
See: https://buddypress.trac.wordpress.org/browser/trunk/src/bp-blogs/bp-blogs-functions.php#L684
There are a number of possible reasons for the absence of a parent item, including:
- BuddyPress has been enabled on an existing WordPress instance
- Site Tracking component has been enabled after posts have already been published.
This is true for all post types that are added via the bp_blogs_record_comment_post_types
hook. I haven't tested with the new method, but looking at the code I expect the behaviour to be the same. Ideal solution would be that if the parent item is not found, that the previous behaviour of adding an independent activity item is maintained.
Attachments (1)
Change History (6)
#1
@
9 years ago
- Component changed from Component - Activity to Component - Blogs
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 2.4
- Owner set to r-a-y
- Status changed from new to assigned
- Version set to 2.0
#2
@
9 years ago
- Keywords has-patch added; needs-patch removed
01.patch
adds a fix and includes a unit test.
Note: This patch records the activity item for the blog post if it doesn't exist when a post comment is posted.
It doesn't loop through any existing comments for the post to record an activity comment for those post comments. Is this important to address for this ticket? I would say not really, but would appreciate some feedback here.
#3
@
9 years ago
I'm in two minds about it, but I think getting this fix in and considering the issue you point out in a future ticket is probably OK. At least this fix means new comments aren't going AWOL, and as old comments have never? been sync'd to the activity, we aren't making a regression by not addressing that now.
This sounds about right and the reasons that you list are valid, needle. Thanks for narrowing the bug down!
I also need to review imath's ticket for comment syncing with CPTs (#6482) as well.