Skip to:
Content

bbPress.org

Opened 6 years ago

Last modified 3 years ago

#2488 reopened defect

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

Reported by: quan_flo Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version: 2.5.1
Component: API - Subscriptions Keywords: has-patch
Cc: trisha@…, vivek@…, kealanf@…, jjjay@…

Description

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.

In case of private groups this also might be a privacy problem. A non-member (or no-longer-member) might have access to private content if other users reply on topics or create content inside the group forum if the no-longer-member still has a sinscroiption to the forum / a topic.

(I use latest bbpress version. It seems as if the "version" dropdown does not contain the actual versions?)

Attachments (4)

2488.diff (2.8 KB) - added by tharsheblows 5 years ago.
unsubscribe users from forum & topics when leaving group
2488.2.diff (5.0 KB) - added by tharsheblows 5 years ago.
unsub / unfav when groups are left
2488.3.patch (15.1 KB) - added by thebrandonallen 4 years ago.
2488.4.diff (10.4 KB) - added by thebrandonallen 3 years ago.

Download all attachments as: .zip

Change History (27)

#1 @johnjamesjacoby
6 years ago

  • Milestone changed from Awaiting Review to 2.6

That's probably a good idea. Let's consider this in 2.6.

I'll make a version for 2.5. Sorry about that.

#2 @netweb
6 years ago

  • Priority changed from high to normal
  • Version changed from 2.4.1 to 2.5.1

#3 @trishasalas
6 years ago

  • Cc trisha@… added

#4 @sooskriszta
6 years ago

  • Cc vivek@… added

#5 @sooskriszta
6 years ago

Should work irrespective of whether user leaves or is removed.

#6 @netweb
5 years ago

Duplicate: #2628

#7 @kjf9
5 years ago

  • Cc kealanf@… added

This defect is still active and is a big hole in the way my site runs. Any possibility this can be patched before 2.6?

This ticket was mentioned in Slack in #bbpress by tharsheblows. View the logs.


5 years ago

#9 follow-up: @tharsheblows
5 years ago

  • Cc jjjay@… added

There is a patch for this in buddypress:#6020 - let me know if that's not what was supposed to happen...

#10 in reply to: ↑ 9 @kjf9
5 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Replying to tharsheblows:

There is a patch for this in buddypress:#6020 - let me know if that's not what was supposed to happen...

Thank you for patching this! I should've guessed that you guys at Buddypress would be working on this as the groups functionality isn't exactly core bbpress...

(I've marked this as fixed, but I'm still new to trac so please undo that if it's not the right protocol)

Last edited 5 years ago by kjf9 (previous) (diff)

#11 @kjf9
5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopened: this issue needs patching in bbPress, not buddypress
see https://buddypress.trac.wordpress.org/ticket/6020#comment:3 for patch and discussion

#12 @tharsheblows
5 years ago

Here is a patch -- fourth, fifth time's the charm, we'll see.

If someone leaves / is banned / is removed from a group, should the forum and topics be unfavorited also?

@tharsheblows
5 years ago

unsubscribe users from forum & topics when leaving group

#13 @kjf9
5 years ago

I would vote yes. If the user isn't affiliated with that group anymore, why should traces remain in their "my account". Definitely for hidden/private groups.

Thank you for all the work you've done on this, really appreciated.

This ticket was mentioned in Slack in #bbpress by netweb. View the logs.


5 years ago

#15 @sooskriszta
5 years ago

On the other hand, if someone is banned by mistake or temporarily, it doesn't seem fair that they lose all their favorites/subscriptions.

#16 @tharsheblows
5 years ago

I think make it filterable so that the defaults work for most people but it's possible to change them if you want (if possible).

But favorites should go as subscriptions, right? I mean in a given situation, if subscriptions are removed, favorites should be removed too. I think that makes sense? It's a bit strange and unintuitive otherwise.

#17 follow-up: @kjf9
5 years ago

Complete agree - they should both go. It doesn't make sense for favs to stay if subs are going.

@sooskriszta The action of banning should have these consequences. If the ban was mistaken that's the admins fault. If it's temporary they should start again freshly when they're un-banned.

#18 @tharsheblows
5 years ago

  • Keywords has-patch added

First go (second go?) - let me know if and when it fails. There is a filter in there so you can change what happens when an action (leave / remove / ban) is taken. Subscriptions and favorites go (or stay) together.

By default, everything is unfavorited and unsubscribed when someone leaves or gets banned or removed. True means "unsubscribe and unfavorite", false means "leave as is" -- eg 'ban_public' => true means if someone is banned from a public group, they will be unsubscribed and their favorites will be removed.

$defaults = array(
			'leave_hidden' => true, 
			'leave_private' => true,
			'leave_public' => true,
			'remove_hidden' => true,
			'remove_private' => true,
			'remove_public' => true,
			'ban_hidden' => true,
			'ban_private' => true,
			'ban_public' => true
		);

You can filter this eg:

function unsub_filter(){
	return array(
			'remove_public' => false,
			'ban_public' => false
		);
}

add_filter( 'bbp_before_group_unsubscribe_parse_args', 'unsub_filter' );

@tharsheblows
5 years ago

unsub / unfav when groups are left

#19 in reply to: ↑ 17 @sooskriszta
5 years ago

Replying to tharsheblows:

But favorites should go as subscriptions, right? I mean in a given situation, if subscriptions are removed, favorites should be removed too. I think that makes sense? It's a bit strange and unintuitive otherwise.

Agree 100%

Replying to kjf9:

@sooskriszta The action of banning should have these consequences. If the ban was mistaken that's the admins fault.

Yes, it would be admin's fault. And we know that people do make mistakes. Good software is fairly fault-tolerant.

If it's temporary they should start again freshly when they're un-banned.

That seems a bit harsh.

This ticket was mentioned in Slack in #bbpress by thebrandonallen. View the logs.


4 years ago

#21 @thebrandonallen
4 years ago

Refresh patch and add tests. The tests were loads of fun to write. They failed... a lot... for reasons I gave up trying to figure out. Running a backtrace inside of a test was the zenith of the fun for me.

#22 @thebrandonallen
3 years ago

Refreshed patch for trunk. PHPDoc fixes.

2488.3.patch and earlier patches used a complicated array structure to determine if a user should be unsubscribed from a group, in a particular situation. This, however, didn't allow you to easily change this for a specific group or user.

New patch replaces all of this with a single filter that allows developers to short-circuit the unsubscribe/unfavorite process on a granular level.

Tests have been updated to reflect this change.

#23 @johnjamesjacoby
3 years ago

  • Milestone changed from 2.6 to 2.7
Note: See TracTickets for help on using tickets.