Bug #441
closed
Members receiving email notifications from groups they've left
Added by Boone Gorges almost 14 years ago.
Updated almost 14 years ago.
Category name:
BuddyPress (misc)
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
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?
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.
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.
Attaching a patch in case that's easier than pulling from my new fangled branch
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.
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).
- 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.
Also available in: Atom
PDF