Skip to:

Opened 2 years ago

Last modified 4 months ago

#3474 new defect (bug)

Subscriptions don't trigger for moderation-held topics/replies

Reported by: dd32's profile dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: API - Subscriptions Keywords:


This was reported 4 years ago for the Support Forums, but I believe it's a bug within the way forum/topic subscriptions work within bbPress with relation to moderation/anti-spam. I was unable to find a relevant bbPress ticket describing this.

In short..

  • Forum notifications (bbp_notify_forum_subscribers()) is hooked to bbp_new_topic (and nothing else, nor is it called from elsewhere)
  • bbp_notify_forum_subscribers() checks a topic is public before notifying, via bbp_is_topic_public
  • bbp_new_topic is triggered from within bbp_new_topic_handler(), which is not called during unspam/approve flows.

Replies have a similar flow.

It seems like there needs to be a new action, bbp_new_topic_published which is triggered by being hooked to bbp_{new,unspammed,approved}_topic.

Alternatively, bbp_notify_forum_subscribers() should be hooked to bbp_{unspammed,approved}_topic. However, there is also the case where those actions should only run once per topic (ie. if it's published, unapproved, then re-approved, it wouldn't make sense to send a notification).

On, I've worked around this by triggering the action bbp_new_topic after unspamming/approving if it wasn't run with a published topic the first time. This is achieved by adding postmeta that specifies the action needs to be re-run. I took the direction of re-running actions, as we have a number of plugins which are hooked to that and bail if the topic isn't public. See for this implementation.

Change History (0)

Note: See TracTickets for help on using tickets.