Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#6020 closed defect (bug) (no action required)

bbpress and buddypress groups - cancel forum and topic subscriptions when group is left by user

Reported by: tharsheblows Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Forums Keywords:
Cc: jjjay@…, kealanf@…

Description

This relates to bbpress:#2488 :

When a user leaves a group, the subscriptions of the buddypress group forum remain.
Maybe you can add an action that all forum AND topics subscriptions from the buddypress group forum are removed when a user leaves a group.

This should unsubscribe users from all group topics and forums when:

  • leaving a group
  • banned from a group
  • removed from a group

Attachments (3)

6020.diff (5.5 KB) - added by tharsheblows 7 years ago.
first go at auto unsub to forum/topics when leaving groups
6020.1.diff (4.8 KB) - added by tharsheblows 7 years ago.
fixing message to be translatable in bp-group-actions
6020.2.diff (599 bytes) - added by tharsheblows 7 years ago.
adds 'groups_leave_group' action

Download all attachments as: .zip

Change History (11)

@tharsheblows
7 years ago

first go at auto unsub to forum/topics when leaving groups

@tharsheblows
7 years ago

fixing message to be translatable in bp-group-actions

#1 @tharsheblows
7 years ago

  • Cc jjjay@… added

#2 @kjf9
7 years ago

  • Cc kealanf@… added

#3 @r-a-y
7 years ago

  • Keywords has-patch removed
  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the patch, tharsheblows.

However, this should be handled in the bbPress plugin and not BuddyPress since you are specifically using bbPress functions inside the core BuddyPress plugin.

You should probably patch /includes/extend/buddypress/groups.php in bbPress. To hook onto the group leave action, use the 'groups_leave_group' action:
https://buddypress.trac.wordpress.org/browser/tags/2.1.1/src/bp-groups/bp-groups-functions.php#L372

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

#5 @tharsheblows
7 years ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Oops, didn't know that was not on! The 'groups_leave_group' action (or another we could use) isn't in https://buddypress.trac.wordpress.org/browser/tags/2.1.1/src/bp-groups/bp-groups-actions.php#L389 so here's a patch for that. The rest will be in bbPress.

@tharsheblows
7 years ago

adds 'groups_leave_group' action

#6 @r-a-y
7 years ago

2.diff shouldn't be necessary since the 'groups_leave_group' action should run for people who successfully leave the group.

Please test your code first and if the hook isn't running, we'll look to add it in.

#7 @tharsheblows
7 years ago

You're right! Sorry about that and thanks for your help. I haven't put the patch up on bbPress yet because I wanted to ask if it should unfavorite them too. I would think so but want to check!

#8 @r-a-y
7 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

I haven't put the patch up on bbPress yet because I wanted to ask if it should unfavorite them too. I would think so but want to check!

I would say remove the favorite if the forum is private or hidden since the user will not have access to the forum any more. Might want to get other people's opinions on bbPress Trac though.

Thanks for working on the patch!

Going to mark this ticket as invalid.

Note: See TracTickets for help on using tickets.