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 | 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.
Having more time to think about this, the
pending-{$topic_id}
slug should be changed topending--{$topic_id}
as I could see a potential conflict where multiple topics may have the topic slug ofpending
andpending-{x+1}
to deal with duplicates.