#15498 closed defect (bug) (fixed)
Notice: Trying to get property of non-object in wp-admin/edit-form-advanced.php on line 281
Reported by: | wpdavis | Owned by: | duck_ |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.3.2 |
Component: | Users | Keywords: | has-patch |
Focuses: | Cc: |
Description
The problem seems to arise from the fact that when users are imported their old IDs aren't mapped to their new IDs, so then $last_user = get_userdata($last_id) is trying to look up a user that doesn't exist.
Attachments (1)
Change History (7)
#2
@
14 years ago
- Milestone Awaiting Review deleted
Note that I was thinking of reintroducing importing _edit_last
since it's used by get_the_modified_author
. If that happens the ID will indeed have to be mapped to the new local ID to stop this.
#3
follow-up:
↓ 4
@
13 years ago
- Component changed from Import to Users
- Keywords needs-patch added
- Resolution invalid deleted
- Status changed from closed to reopened
- Version set to 3.3.2
This error does still exist when deleting a user and reasigning the posts to an other user. Not only the post_author in wp_posts should be changed, please update wp_postmeta too.
UPDATE wp_postmeta
SET meta_value
='NEW-USER-ID' WHERE meta_key
='_edit_last';
An other solution would be to check the object in edit-form-advanced.php and display 'unknown user' when it is null.
#4
in reply to:
↑ 3
@
13 years ago
- Keywords has-patch added; needs-patch removed
- Milestone set to Future Release
Replying to Ludwig C.:
This error does still exist when deleting a user and reasigning the posts to an other user. Not only the post_author in wp_posts should be changed, please update wp_postmeta too.
Good point. Attached a patch to include the get_userdata() call in the conditional.
Killing this off — was using old version of WP importer.