#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_ |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Users | Version: | 3.3.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
16 years ago
- Milestone Awaiting Review
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
@
14 years ago
- Component Import → Users
- Keywords needs-patch added
- Resolution invalid
- Status closed → reopened
- Version → 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
@
14 years ago
- Keywords has-patch added; needs-patch removed
- Milestone → 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Killing this off — was using old version of WP importer.