Opened 8 years ago
Closed 8 years ago
#6981 closed defect (bug) (fixed)
PHP debug notices when deleting a WordPress user
Reported by: | henry.wright | Owned by: | DJPaul |
---|---|---|---|
Milestone: | 2.6 | Priority: | normal |
Severity: | normal | Version: | 2.5.0 |
Component: | Core | Keywords: | needs-patch good-first-bug |
Cc: |
Description
Steps to reproduce:
- Disable BuddyPress
- Create a new user by going to Users > Add New in the admin area
- Enable BuddyPress
- Go to Users > All Users in the admin area
- Tick the checkbox next to the user you just created.
- Select Delete from the "Bulk Actions" option list and click on the Apply button.
Attachments (1)
Change History (9)
#2
@
8 years ago
- Keywords reporter-feedback removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
@DJPaul I just tried to grab a screenshot for you but I can't seem to reproduce this problem now. I will close and reopen if it happens again.
#3
@
8 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
So I experienced this issue again and this time I managed to grab a screenshot. See the attached file.
#4
@
8 years ago
- Component changed from API to Component - Core
- Keywords needs-patch good-first-bug added
- Milestone set to 2.6
Odd - something to do with our wpdb->delete
call, maybe it's not in the right format.
#7
@
8 years ago
If you create a new user as described then immediately delete it, it never has a last_activity
set. BP_Core_User::delete_last_activity()
assumes it always will, and a null value gets passed to wpdb->delete
which chokes wpdb->prepare
which throws the "doing_it_wrong" error.
I've added a test in r10748 to capture this.
@henry.wright It'd be useful if you could copy/paste the debug notice for reports like this, please. :)