Opened 7 years ago
Last modified 3 days ago
#7636 new defect (bug)
Cover image orphaned when user is deleted
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Awaiting Contributions | Priority: | normal |
Severity: | normal | Version: | 2.9.2 |
Component: | Media | Keywords: | good-first-bug has-patch |
Cc: | wordpress@… |
Description
When a WordPress user is deleted, WP tidies up and deletes any user avatar, normally stored in /uploads/avatars/<usernumber> and the enclosing folder.
However, when a BuddyPress user is deleted through WordPRess, any cover image, normally stored in /uploads/buddypress/members/<usernumber> is left orphaned.
I think the cover images and the enclosing folder should be deleted.
This is the case for v2.9.2, which is not in the version list pull-down.
Thanks for the good work!
Change History (6)
#2
@
7 years ago
- Component changed from Core to Media
- Keywords needs-patch added
- Milestone changed from Awaiting Review to Future Release
- Version changed from 2.9.0 to 2.9.2
#3
@
7 years ago
- Keywords good-first-bug added
I started writing the patch (which is easy) but got caught up on the unit tests (which are almost impossible, because we have no procedural way of setting cover images). Tests are probably a nice-to-have, but not a must, for this ticket.
This ticket was mentioned in PR #409 on buddypress/buddypress by @amitraj2203.
6 days ago
#4
- Keywords has-patch added; needs-patch removed
- Added functions to delete the user’s cover image and related folder during user deletion.
- Ensure cover images are properly removed when a user is deleted by hooking into
delete_user
andwpmu_delete_user
. - This prevents orphaned cover image files in
/uploads/buddypress/members/<user_id>
.
Trac ticket: https://buddypress.trac.wordpress.org/ticket/7636
#5
@
6 days ago
Hi @boonebgorges @DJPaul,
I've raised a [PR]https://github.com/buddypress/buddypress/pull/409 for this ticket, could you please review it when you get a chance?
Thanks!
@amitraj2203 commented on PR #409:
3 days ago
#6
Hey @boonebgorges, just pinging you for a review on this PR. I’d really appreciate it if you could take a look. Thanks!
We need to update something like
bp_core_delete_avatar_on_user_delete()
to do this.