• Resolved Doug

    (@nicoblog)


    Hello, i have this problem:
    http://wordpress.stackexchange.com/questions/11725/why-are-my-roles-not-visible-in-a-multi-site-network

    Plus when i go to network admin -> all sites click edit on any site and go to “users” tab i see this error:
    Warning: array_keys() expects parameter 1 to be array, boolean given in /home/nicoorg/public_html/wp-admin/includes/class-wp-users-list-table.php on line 307

    I checked the database and all seems fine:
    wp_2_options contains wp_2_user_roles
    wp_3_options contains wp_3_user_roles
    etc
    wp_options contains no user roles (as it should)

    So all rows exist all names are fine. I’ve disabled all plugins back to default theme, no changes. What else can i try?

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Have you installed a plugin that manages roles? I would deactivate it to see if you still get errors.

    Sorry I saw you deactivated them. But maybe the plugin removed information it shouldnt have. Have you tried re-creating the wp_user_roles entry in wp_options?

    Thread Starter Doug

    (@nicoblog)

    This installation i’ve been using it for 2 years testing all kinds of plugins but i didn’t need the roles until recently so i didn’t notice the error.

    I’m sure my user roles are probably full of useless stuff, but i don’t know how to re create it.

    You should try figuring out which plugin affected your roles. Did you use a plugin called User Role Editor? I believe that plugin allows you to delete all roles. It also allows you to put the default values back in. Additionally when you delete your default roles, it also backs up the original roles to ‘backup_user_roles’. Using the plugin to fix your problem is the safest way to proceed.

    Barring that you could attempt to copy the roles from one table to another. You do have to rename the option.

    Thread Starter Doug

    (@nicoblog)

    I installed that plugin today i thought it could fix my problem but the options menu of it comes full of errors
    https://wordpress.org/support/topic/warning-invalid-argument-supplied-for-foreach-65?replies=1

    I also took this user roles from here
    http://wp-relief.com/2011/12/01/user-roles-in-the-wordpress-database/

    and switched it with mines on my 3 network sites, no dice. steal same.

    Thread Starter Doug

    (@nicoblog)

    Is this normal?
    http://postimg.org/image/6fpz1ja87/

    Shouldn’t i have all the roles there?
    a:1:{s:13:”administrator”;b:1;}
    a:1:{s:6:”editor”;b:1;}
    a:1:{s:6:”author”;b:1;}
    a:1:{s:11:”contributor”;b:1;}
    a:1:{s:10:”subscriber”;b:1;}

    I have 3 instances of WP. They all have a wp_user_roles entry in the wp_options table. IMO, if you add that entry it should fix your network problem. You might want to enable debugging to see if there are further errors.

    Thread Starter Doug

    (@nicoblog)

    I FIXED it.
    I did not have a row “wp_user_roles” on “wp_options” table at all.
    So i created it. And took the content from a clean WP installation, which is:

    a:5:{s:13:”administrator”;a:2:{s:4:”name”;s:13:”Administrator”;s:12:”capabilities”;a:62:{s:13:”switch_themes”;b:1;s:11:”edit_themes”;b:1;s:16:”activate_plugins”;b:1;s:12:”edit_plugins”;b:1;s:10:”edit_users”;b:1;s:10:”edit_files”;b:1;s:14:”manage_options”;b:1;s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:6:”import”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:8:”level_10″;b:1;s:7:”level_9″;b:1;s:7:”level_8″;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;s:12:”delete_users”;b:1;s:12:”create_users”;b:1;s:17:”unfiltered_upload”;b:1;s:14:”edit_dashboard”;b:1;s:14:”update_plugins”;b:1;s:14:”delete_plugins”;b:1;s:15:”install_plugins”;b:1;s:13:”update_themes”;b:1;s:14:”install_themes”;b:1;s:11:”update_core”;b:1;s:10:”list_users”;b:1;s:12:”remove_users”;b:1;s:9:”add_users”;b:1;s:13:”promote_users”;b:1;s:18:”edit_theme_options”;b:1;s:13:”delete_themes”;b:1;s:6:”export”;b:1;}}s:6:”editor”;a:2:{s:4:”name”;s:6:”Editor”;s:12:”capabilities”;a:34:{s:17:”moderate_comments”;b:1;s:17:”manage_categories”;b:1;s:12:”manage_links”;b:1;s:12:”upload_files”;b:1;s:15:”unfiltered_html”;b:1;s:10:”edit_posts”;b:1;s:17:”edit_others_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:10:”edit_pages”;b:1;s:4:”read”;b:1;s:7:”level_7″;b:1;s:7:”level_6″;b:1;s:7:”level_5″;b:1;s:7:”level_4″;b:1;s:7:”level_3″;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:17:”edit_others_pages”;b:1;s:20:”edit_published_pages”;b:1;s:13:”publish_pages”;b:1;s:12:”delete_pages”;b:1;s:19:”delete_others_pages”;b:1;s:22:”delete_published_pages”;b:1;s:12:”delete_posts”;b:1;s:19:”delete_others_posts”;b:1;s:22:”delete_published_posts”;b:1;s:20:”delete_private_posts”;b:1;s:18:”edit_private_posts”;b:1;s:18:”read_private_posts”;b:1;s:20:”delete_private_pages”;b:1;s:18:”edit_private_pages”;b:1;s:18:”read_private_pages”;b:1;}}s:6:”author”;a:2:{s:4:”name”;s:6:”Author”;s:12:”capabilities”;a:10:{s:12:”upload_files”;b:1;s:10:”edit_posts”;b:1;s:20:”edit_published_posts”;b:1;s:13:”publish_posts”;b:1;s:4:”read”;b:1;s:7:”level_2″;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;s:22:”delete_published_posts”;b:1;}}s:11:”contributor”;a:2:{s:4:”name”;s:11:”Contributor”;s:12:”capabilities”;a:5:{s:10:”edit_posts”;b:1;s:4:”read”;b:1;s:7:”level_1″;b:1;s:7:”level_0″;b:1;s:12:”delete_posts”;b:1;}}s:10:”subscriber”;a:2:{s:4:”name”;s:10:”Subscriber”;s:12:”capabilities”;a:2:{s:4:”read”;b:1;s:7:”level_0″;b:1;}}}

    And the error is gone users work fine now.

    Thanks jkhongusc for help.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Users and roles features broken’ is closed to new replies.