Skip to:
Content

bbPress.org

Opened 5 years ago

Closed 6 days ago

#3430 closed defect (bug) (fixed)

BuddyPress: Pending group topics cannot be viewed

Reported by: r-a-y Owned by: johnjamesjacoby
Priority: normal Milestone: 2.6.20
Component: Extend - BuddyPress Version: 2.2
Severity: normal 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 5 years ago.
3430.02.patch​ (5.0 KB ) - added by r-a-y 5 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 (6)

@r-a-y
5 years ago

#1 @r-a-y
5 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
5 years ago

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

#2 @johnjamesjacoby
6 days ago

In 7878:

BuddyPress Groups: Restore pending topic access.

Route pending group topics by explicit topic ID while preserving their group forum context. Authors and users who can read pending topics can view and edit them with the normal group templates, while invalid and cross-group topic IDs remain unreadable.

Preserve pending-topic redirects and reply pagination without changing published topic permalinks.

In trunk, for 2.7.

Props r-a-y.
See #3430.

#3 @johnjamesjacoby
6 days ago

  • Milestone Awaiting Review → 2.6.20

#4 @johnjamesjacoby
6 days ago

  • Owner set to johnjamesjacoby
  • Resolution → fixed
  • Status new → closed

In 7881:

BuddyPress Groups: Restore pending topic access.

Route pending group topics by explicit topic ID while preserving their group forum context. Authors and users who can read pending topics can view and edit them with the normal group templates, while invalid and cross-group topic IDs remain unreadable.

Preserve pending-topic redirects and reply pagination without changing published topic permalinks.

In branches/2.6, for 2.6.20.

Props r-a-y.
Fixes #3430.

Note: See TracTickets for help on using tickets.