Bug #441
closedMembers receiving email notifications from groups they've left
0%
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
Updated by Matt Gold almost 14 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?
Updated by Boone Gorges almost 14 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.
Updated by Boone Gorges almost 14 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.
Updated by Boone Gorges almost 14 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 :)
Updated by Boone Gorges almost 14 years ago
Attaching a patch in case that's easier than pulling from my new fangled branch
Updated by Chris Stein almost 14 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.
Updated by Boone Gorges almost 14 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).
Updated by Boone Gorges almost 14 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.