#36757 closed defect (bug) (invalid)
Wordpress Bug
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5.1 |
Component: | Users | Keywords: | |
Focuses: | Cc: |
Description
I deleted two users off of Wordpress. When I go to access the dashboard or to edit a page, I received this error.
Fatal error: Call to a member function has_cap() on a non-object in /home/content/96/9964196/html/wp-content/plugins/wpmudev-updates/includes/class-wpmudev-dashboard-site.php on line 11597
A look at the function which contains line 1597, where line 1597 is if ( ! $user->has_cap( $need_cap ) ) {
Remove invalid users from the allowed-users-list.
foreach ( $allowed as $key => $user_id ) {
$user = get_userdata( $user_id );
if ( $user && ! $user->has_cap( $need_cap ) ) {
unset( $allowed[ $key ] );
$changed = true;
}
}
if ( $changed ) {
WPMUDEV_Dashboard::$site->set_option( 'limit_to_user', $allowed );
}
}
}
if ( $id_only ) {
$result = $allowed;
} else {
$result = array();
foreach ( $allowed as $user_id ) {
if ( $user_info = get_userdata( $user_id ) ) {
$result[] = array(
'id' => $user_id,
'name' => $user_info->display_name,
'is_me' => get_current_user_id() == $user_id,
'profile_link' => get_edit_user_link( $user_id ),
);
}
}
}
return $result;
}
to fix this error I had to add this to line 1597
if ( $user && ! $user->has_cap( $need_cap ) ) {
Attachments (1)
Change History (3)
#1
@
7 years ago
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
Hello @ilovechocolatemuffins, welcome to our Trac!
This Trac is used for enhancements and bug reporting for the WordPress core software. Your error comes from a file which is shipped with one of your WPMU DEV plugins. You have to contact their support.