Opened 10 years ago
Closed 10 years ago
#5857 closed enhancement (fixed)
In multisite a user removed from spammers will not have his sites restored
Reported by: | imath | Owned by: | djpaul |
---|---|---|---|
Milestone: | 2.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Blogs | Keywords: | has-patch |
Cc: |
Description
I've noticed testing 2.0.2 with WordPress 4.0.RC3 that when marking a user as a spammer, all BuddyPress data is deleted including the user's recorded blog(s).
When you ham the user, his profile won't show user's blog(s) anymore. In 2.1, the tool to recalculate blog records fix this, but i wonder if it would be a good idea to restore the user's blog records (and not all blog records) when the user is removed from the spammers.
Adding a patch, just in case.
Attachments (4)
Change History (10)
#2
in reply to:
↑ 1
@
10 years ago
- Keywords has-patch added; needs-refresh removed
Replying to DJPaul:
Let's get the
get_blogs_of_user( 2 )
corrected, and add a unit test.
Thanks a lot for the feedback, i made a silly mistake there! Wow!
Corrected it in 5857.02.patch and added a unit test. Using the unit test made me change the function to restore user's blog association in order to be sure it respects bp_get_current_blog_roles()
#3
follow-up:
↓ 4
@
10 years ago
I've updated the patch. I removed an unused $old_user
variable, changed $b2
to be created the same as $b1
(I didn't understand why it was different), and switched a assertFalse( $expected == array_map(
to use assertNotEquals
to un-confuse myself and create some symmetry with the other assertion.
If this is OK with you imath, feel free to commit it.
#4
in reply to:
↑ 3
@
10 years ago
Replying to DJPaul:
If this is OK with you imath, feel free to commit it.
Thanks a lot DJPaul. When i've run the complete tests i had an error 'blog already taken'. So in 5857.04.patch i'm using a path var to avoid it. I think we don't need bp_blogs_record_existing_blogs()
and i'd rather not use it as i've noticed while working on #1269 that it was causing a lot of tests to fail. Didn't figure out why.
Are you ok with the changes in the tests ?
Let's get the
get_blogs_of_user( 2 )
corrected, and add a unit test.