Project

General

Profile

Actions

Bug #441

closed

Members receiving email notifications from groups they've left

Added by Boone Gorges over 13 years ago. Updated over 13 years ago.

Status:
Resolved
Priority name:
High
Assignee:
Category name:
BuddyPress (misc)
Target version:
Start date:
2010-12-07
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

One unintended result of the way that I transferred old subscription settings to the new ones is that members who had once been a member of a given group but had since left it were subscribed to emails in that group. That is a function of the fact that the old plugin was sloppy about removing that data from the system when someone left a group. I probably should have checked against current group membership instead of using only those old settings as a data point, but what's done is done.

My plan is to write another script that loads the subscription data for each group and checks it against the membership rolls. If a subscribed user is not currently a member of the group, he will have his subscription removed.

NB this is probably not a problem for that many people, as I would imagine that few people have left as many groups as I have (for testing, etc).


Files

441.diff (1.69 KB) 441.diff Boone Gorges, 2010-12-07 05:00 PM
Actions #1

Updated by Matt Gold over 13 years ago

Okay. I agree that this is high priority, as members could find this bug frustrating.

Do you think it is worth writing about known bugs anywhere? What are your thoughts now about the timing of the 1.1.1 release?

Actions #2

Updated by Boone Gorges over 13 years ago

I'd like to do a 1.1.1 either tomorrow or Thursday that fixes the more annoying bugs. I'd say it's not worthwhile to write about known bugs until after that.

Actions #3

Updated by Matt Gold over 13 years ago

Sounds good - thanks.

Actions #4

Updated by Boone Gorges over 13 years ago

I just wrote a little script to detect this, and the good news is that, on my local installation (and a several-months-out-of-date database) there are only a dozen or so instances of the problem. So we're probably not looking at something huge.

In any case, it will be fixed with 1.1.1.

Actions #5

Updated by Boone Gorges over 13 years ago

Here's the script: https://github.com/castiron/cac/commit/98558283a60af248b001be3e3b35a7a619b4ee89

Ron or Chris, if one of you could take 5 minutes to glance at it and make sure that nothing insane is happening, I'd appreciate it :)

Actions #6

Updated by Boone Gorges over 13 years ago

Attaching a patch in case that's easier than pulling from my new fangled branch

Actions #7

Updated by Boone Gorges over 13 years ago

Actions #8

Updated by Chris Stein over 13 years ago

Boone,
I don't have time to try running this but looking over it the logic seems OK to me. I also don't know much about how the group member and group meta tables are so could only look at the general logic there.

I don't know if this will be an issue or not but it appears that when you use unset() on arrays it doesn't alter the indexes for the items in the array so they can be messed up. In the comments on this php.net page is where I saw it.
http://php.net/manual/en/function.unset.php
Look for the comment
j dot vd dot merwe at enovision dot net
26-Aug-2010 12:08

I'm guessing that would only be a problem if you wanted to loop back through the array again but you can do what that person has and add something like
$subs = array_values($subs);
to reset the indexes.

Actions #9

Updated by Boone Gorges over 13 years ago

Thanks, Chris. I'm aware of how unset() works with array keys. In this case the indexes don't matter (since the arrays in question are associative - indexed by member id - I don't want them to be reindexed).

Actions #10

Updated by Boone Gorges over 13 years ago

  • Status changed from Assigned to Resolved

Marking as resolved given the feedback from Ron and Chris. The fix will be run on the production server after 1.1.1 is launched.

Actions

Also available in: Atom PDF