chnm / thatcamp-org

Codebase for thatcamp.org
Other
8 stars 7 forks source link

AACK. Users being added to sites with no role or as participants #44

Closed amandafrench closed 11 years ago

amandafrench commented 11 years ago

This bug has been happening for about a week now on the production server, and it's a serious problem. Any new site seems to automatically attract a bunch of new users, and I have to say I'm at a loss as to why. They show up with no role or as BuddyPress Participants. For instance, I just created a new site (I think 2 days ago) for THATCamp Caribbean at http://caribbean2013.thatcamp.org, and it's now got 23 users where it should have only 2. The THATCamp Registrations plugin is set for closed registrations, and I didn't create the site using the WP Replicator.

In the user list below, only the 2 users with Administrator role are correct. The others were added by I know not what means.

Admin Istrator  mvandegrift@fsu.edu None    0   3215
Anne Jonas  ajonas@barnard.edu  None    0   3884
Amanda French   amanda@amandafrench.net None    0   7
Ann Matsuuchi   amatsuuchi@lagcc.cuny.edu   None    0   4114
Ammon Shepherd  ashephe1@gmu.edu    None    0   261
Donna Lanclos   dlanclos@uncc.edu   None    0   2700
Alex Gil    colibri.alex@gmail.com  Administrator   1   358
Emily Sherwood  emilygwynne@gmail.com   None    0   4753
Erica Yozell    emy@moravian.edu    None    0   2504
Heather Simoneau    hms207@Lehigh.EDU   None    0   3302
Jessica Aberle  jea211@lehigh.edu   None    0   1466
Leila Walker    leilaswalker@gmail.com  None    0   4744
    hposey@providence.edu   None    0   4606
    ltroost@washjeff.edu    None    0   4726
Micah Vandegrift    micahvandegrift@gmail.com   None    0   878
    negracubana@cubarte.cult.cu Administrator   0   4750
Monique OConnell    oconneme@wfu.edu    None    0   4214
Roberta Walker Kilkenny roberta.kilkenny@hunter.cuny.edu    None    0   4165
Samantha Parish sparish@chatham.edu None    0   3407
susanna.horng   susanna.horng@nyu.edu   None    0   3145
Tim Sherratt    tim@discontents.com.au  None    0   852
Valerie Booth   vab42@drexel.edu    None    0   3069
Vani Natarajan  vnataraj@barnard.edu    None    0   3021
amandafrench commented 11 years ago

Could it be linked to Participad, I wonder?

boonebgorges commented 11 years ago

OK, I believe I tracked it down.

It's a long story, but it's a bug in bbPress that I actually uncovered and reported a couple of weeks ago while working on a different project: https://bbpress.trac.wordpress.org/ticket/2103 I put a temporary fix into an mu-plugin file for now, and the bbPress fix will automatically override it when a new version of bbPress is next released.

As for the existing problematic users, I wrote a script that looked through every user-blog relationship, and deleted all those auto-created by bbPress. I believe this cleans it up properly. Please have a look around.

amandafrench commented 11 years ago

Fabulous. Everything looks great. Ah, I need to be clearer about the difference between BuddyPress and bbPress, sorry -- now that I think of it, it was as "bbpress" participants that the users showed up in Network admin. Thanks LOADS, Boone. And you were right as usual, of course, that it wasn't the server move that did it.

boonebgorges commented 11 years ago

Glad to hear it's fixed - and I'm relieved that it was easy to run through and find the incorrect user-blog relationships (that wouldn't have been fun to do manually)

On 01/08/2013 08:22 AM, Amanda French wrote:

Fabulous. Everything looks great. Ah, I need to be clearer about the difference between BuddyPress and bbPress, sorry -- now that I think of it, it was as "bbpress" participants that the users showed up in Network admin. Thanks LOADS, Boone. And you were right as usual, of course, that it wasn't the server move that did it.

— Reply to this email directly or view it on GitHub https://github.com/chnm/thatcamp-org/issues/44#issuecomment-11996734.

amandafrench commented 11 years ago

No kidding. The user-blog relationships look close enough -- I checked three sites that I hadn't fixed manually and they seem right. The script did remove me from a lot of THATCamps that I actually went to, but that's no big deal. My blog posts are still attributed to me, since I'm super admin. Even if it introduced some errors, I'm happy to fix them manually as long as they don't get introduced again.

By the way, I meant to mention that I'll make a note not to update bbPress until I'm sure the issue you link to above has been resolved.

boonebgorges commented 11 years ago

The script did remove me from a lot of THATCamps that I actually went to

I'm guessing that this is a feature rather than a bug. As a matter of fact, you probably were never actually added as a User to those THATCamps. Super admins are able to post blog posts without having a role on the blog. This shouldn't apply to anyone else, since they'd need to have a role in order to post, and thus they'd show up on the Users list.

On 01/08/2013 09:28 AM, Amanda French wrote:

No kidding. The user-blog relationships look close enough -- I checked three sites that I hadn't fixed manually and they seem right. The script did remove me from a lot of THATCamps that I actually went to, but that's no big deal. My blog posts are still attributed to me, since I'm super admin. Even if it introduced some errors, I'm happy to fix them manually as long as they don't get introduced again.

By the way, I meant to mention that I'll make a note not to update bbPress until I'm sure the issue you link to above has been resolved.

— Reply to this email directly or view it on GitHub https://github.com/chnm/thatcamp-org/issues/44#issuecomment-11998923.

amandafrench commented 11 years ago

No, I was a user on those sites -- I made sure of it, because the Campers pages in the themes pull in only the users of that site (not the super admins on the network). And those sites showed up in My Sites in the Dashboard, whereas I've only got a couple in that list now.

Just wanted to mark the occasion when I was right and you were wrong. :P

boonebgorges commented 11 years ago

You win. I lose.

On 01/10/2013 11:09 AM, Amanda French wrote:

No, I was a user on those sites -- I made sure of it, because the Campers pages in the themes pull in only the users of that site (not the super admins on the network). And those sites showed up in My Sites in the Dashboard, whereas I've only got a couple in that list.

Just wanted to mark the occasion when I was right and you were wrong. :P

— Reply to this email directly or view it on GitHub https://github.com/chnm/thatcamp-org/issues/44#issuecomment-12104094.

amandafrench commented 11 years ago

This issue is back, probably because I foolishly upgraded BBPress with the auto-update. I suspect I could fix it (at least for the future, though the users with no role are back on a bunch of sites) by commenting out add_action( 'switch_blog', 'bbp_set_current_user_default_role' ); in /core/actions.php as per https://bbpress.trac.wordpress.org/changeset/4591, but the thatcamp group doesn't have permission to edit the file on either dev or production. I'm guessing you set it that way on purpose, so I'll refrain from getting Ammon to give me permissions. :)

boonebgorges commented 11 years ago

For some reason, the code that I'd written as a workaround to this issue was rolled back on the live server. I'm not totally sure how this would have happened - either someone rewrote the files at some point (reimporting the codebase from an older backup), or someone was messing around with git on the live server, or someone manually opened mu-plugins/thatcamp-group-blogs.php and removed the code.

In any case, I've restored it. Do I need to rerun the script that removes people from stray blogs?

On 01/29/2013 12:46 PM, Amanda French wrote:

This issue is back, probably because I foolishly upgraded BBPress with the auto-update. I suspect I could fix it (at least for the future, though the users with no role are back on a bunch of sites) by commenting out add_action( 'switch_blog', 'bbp_set_current_user_default_role' ); in /core/actions.php as per https://bbpress.trac.wordpress.org/changeset/4591, but the thatcamp group doesn't have permission to edit the file on either dev or production. I'm guessing you set it that way on purpose, so I'll refrain from getting Ammon to give me permissions. :)

— Reply to this email directly or view it on GitHub https://github.com/chnm/thatcamp-org/issues/44#issuecomment-12847582.

amandafrench commented 11 years ago

That was me: during last week's hooha I wrote over mu-plugins at one point. I have resorted to post-its now to remind me not to do that. Which file is the fix in?

Yes, please do rerun the script. Note too that site id 168 (http://ozha2013.thatcamp.org) has 7k users and about 700 of them have that site listed incorrectly listed as their primary blog.

boonebgorges commented 11 years ago

Which file is the fix in? wp-content/mu-plugins/thatcamp-group-blogs.php

Yes, please do rerun the script. I've rerun it, and it cleaned up a few dozen improper site attributions.

ozha2013 is still a mess. These users all have Author status, which means that it's a separate problem from what's described earlier in this ticket. I'm not sure what the issue is, or, to be honest, how to debug it. Do you have any idea who should be a member of that site?

On 01/29/2013 02:01 PM, Amanda French wrote:

That was me: during last week's hooha I wrote over mu-plugins at one point. I have resorted to post-its now to remind me not to do that. Which file is the fix in?

Yes, please do rerun the script. Note too that site id 168 (http://ozha2013.thatcamp.org) has 7k users and about 700 of them have that site listed incorrectly listed as their primary blog.

— Reply to this email directly or view it on GitHub https://github.com/chnm/thatcamp-org/issues/44#issuecomment-12851333.

amandafrench commented 11 years ago

Let me write Tim Sherratt, who's the only one I know for sure should be a member of the site, before you do any debugging. We've done some dev work with him, I think, so for all I know he has backend access to the server (though I doubt it) and did something on purpose that had that result. At least I can verify that he didn't do anything that might've caused that.

amandafrench commented 11 years ago

For now, Boone, maybe just remove all users from site id=168 except for Tim, user id=852. (Username 'tim'.) Unless you have any brilliant ideas, I say chalk this up to some unknown aspect of last week's cluster of ducks. If it happens again, we can worry about debugging.

boonebgorges commented 11 years ago

OK, I've removed all users but Tim from the blog. Please keep an eye on things, and ping me if it happens again.

amandafrench commented 11 years ago

Will do, thanks. I'll leave the issue open for now.

amandafrench commented 11 years ago

Haven't had any trouble with this lately, so I'll close the issue.