Skip to:
Content

#3180 closed defect (fixed)

Commenting on activity for topics and replies cannot be enabled

Reported by: jdgrimes Owned by: johnjamesjacoby
Milestone: 2.6 Priority: normal
Severity: normal Version: 2.5.14
Component: Extend - BuddyPress Keywords:
Cc:

Description

I have just reproduced this on a fresh install of the latest versions of bbPress, BuddyPress, and WordPress.

BuddyPress activity items created for a forum topics and replies do not have commenting enabled by default. However, there is a setting offered by BuddyPress, "Allow activity stream commenting on blog and forum posts." But even when this checkbox is checked, comments are not enabled on activity items for forum posts.

Tracing this down revealed that BuddyPress handles things properly, and it is actually the \BBP_BuddyPress_Activity::activity_can_comment() function, which is hooked to the 'bp_activity_can_comment' filter, that is causing the issue. The code that is the problem is this:

<?php

                if ( ( false === $activities_template->disable_blogforum_replies ) || (int) $activities_template->disable_blogforum_replies ) {

Because the value is always a boolean, this always fails. The value is saved as 1 or 0, but it cast to a bool in \BP_Activity_Template::__construct():

<?php

                $this->disable_blogforum_replies = (bool) bp_core_get_root_option( 'bp-disable-blogforum-comments' );

A client just noticed this on their site, as it apparently worked before. Neither bbPress nor BuddyPress appear to have made changes to this recently though, so I'm not sure what broke this. Perhaps it is related to some change in WordPress?

The workaround was to unhook that bbPress method for now, and all works as expected.

Change History (3)

#1 @espellcaste
15 months ago

This seems a bug or a problem on BuddyPress and not bbPress. I'd recommend opening a ticket: https://buddypress.trac.wordpress.org/newticket

#2 @johnjamesjacoby
10 months ago

  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

#3 @johnjamesjacoby
10 months ago

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

In 6810:

BuddyPress: prefer empty() check on disable_blogforum_replies setting.

This fixes a bug causing some activity to not appear in relative activity streams.

Fixes #3180.

Note: See TracTickets for help on using tickets.