Skip to:
Content

bbPress.org

Opened 4 years ago

Last modified 4 years ago

#3430 new defect (bug)

BuddyPress: Pending group topics cannot be viewed

Reported by: r-a-y's profile r-a-y Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.2
Component: Extend - BuddyPress Keywords: has-patch
Cc:

Description

One of our users reported that pending group topics cannot be viewed on the frontend.

The problem is the topic lookup within a BuddyPress group forum looks against the post name: https://github.com/bbpress/bbPress/blob/09313c9984c55429f3e664ca4383768b68ee34b9/src/includes/extend/buddypress/groups.php#L1033. A pending topic does not have a post name, so the lookup fails.

Attached is a patch, which fixes this by changing a pending group topic's slug to 'pending-{$topic_id}' and switches up the logic to query pending group topics by the post ID.

This is related to the other moderation tickets: #3349, #3353.

Attachments (2)

3430.01.patch (4.9 KB) - added by r-a-y 4 years ago.
3430.02.patch (5.0 KB) - added by r-a-y 4 years ago.
Uses 'pending--{$topic_id}' for pending group topic slugs. Also replaces some hardcoded 'pending' slug instances.

Download all attachments as: .zip

Change History (3)

@r-a-y
4 years ago

#1 @r-a-y
4 years ago

Having more time to think about this, the pending-{$topic_id} slug should be changed to pending--{$topic_id} as I could see a potential conflict where multiple topics may have the topic slug of pending and pending-{x+1} to deal with duplicates.

@r-a-y
4 years ago

Uses 'pending--{$topic_id}' for pending group topic slugs. Also replaces some hardcoded 'pending' slug instances.

Note: See TracTickets for help on using tickets.