Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#5873 closed defect (bug) (fixed)

bp_core_get_packaged_component_ids() conflict with bbPress

Reported by: r-a-y Owned by: djpaul
Milestone: 2.1 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch
Cc:

Description

If you enable the bbPress plugin and navigate to a user's "Forums" page, you'll notice that the subnav is missing (Topics Started, Replies Created, Favorites, Subscriptions).

The issue is the addition of the bp_core_get_packaged_component_ids() function, which is used in bp_is_current_component_core() and then used in the /members/single/plugins.php template for subnav rendering checks.

The 'forums' ID references the legacy forums component. However, the 'forums' ID is also used by the bbPress plugin when registering its BP component.

Attached patch checks to see if the legacy forums component is enabled using class_exists(). If it is enabled, we add the 'forums' ID back in.

Attachments (1)

5873.01.patch (685 bytes) - added by r-a-y 5 years ago.

Download all attachments as: .zip

Change History (7)

@r-a-y
5 years ago

#1 @DJPaul
5 years ago

Can you explain why bp_is_active( 'forums' ) wouldn't work here?

#2 @r-a-y
5 years ago

You're right. bp_is_active( 'forums' ) does work.

For some reason, I thought bbPress was registering itself as an active component in BP, but it's not.

In BP Skeleton Component, we've been telling plugin devs to register themselves into the $bp->active_components array, but bbPress doesn't do this.

I'm okay with going with the bp_is_active() check, but the class check is more accurate.

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

#3 @DJPaul
5 years ago

Perhaps new bbPress doesn't do that for compatibility with this kind of code in BuddyPress; that kind of makes sense. I agree with your class check in case new bbPress ever changes in the future.

#4 @DJPaul
5 years ago

See also #5864

#5 @SGr33n
5 years ago

Hi :)

From #5864 I would also report that on the user replies page, the reply button in the "bbp-reply-header" redirect to a wrong BuddyPress page instead of the correct bbPress page.

E.g.
http://www.example.com/users/sgr33n/forums/replies/?bbp_reply_to=138241&_wpnonce=85d9499b4f#new-post

Instead of:

http://www.example.com/forum/topic/topic-permalink/?bbp_reply_to=138241&_wpnonce=85d9499b4f#new-post

#6 @djpaul
5 years ago

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

In 9012:

Core: only return forums from bp_core_get_packaged_component_ids() if using bbPress 1.

This otherwise causes the bbPress 2's subnav bar to not be rendered in templates due to the behaviour of members/single/plugins.php.

We would normally consider using bp_is_active for this kind of check, but because both bbPress 1 and (possibly, in the future) 2 could return true, we need a more reliable check for bbPress 1 only; see the ticket for full details.

See #5552. Fixes #5873, props r-a-y.

Note: See TracTickets for help on using tickets.