Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

My network is showing roles in some sites and not in others.

For some reason that I can't explain, when I add a new user, I have no role to choose from on the drop down box of a sub-site in my network. Also my new user assigned to a site is not showing on my list of users for that site.

Is this something fixable?

Below an image of the current situation.

http://cl.ly/58xU

Roles not Showing

Below is the picture showing the main site with the roles properly there, but the sub-sites of the network don't.

Roles showing

share|improve this question
1  
That role dropdown is comming from a plugin, so you should notify the plugin author. –  scribu Mar 11 '11 at 0:27
    
My main site in the network shows the dropdown, just the two sub-sites don't show anything. What plugin? I don't have any plugin related to roles. –  Geo Mar 11 '11 at 0:43
    
You're right. It's not from a plugin. Very strange. –  scribu Mar 11 '11 at 1:18
    
Geo, you currently have an 10 questions and have closed out only one. I encourage you to pick the best answer from your previous questions. You will find people are reluctant to answer your questions when it looks like you don't actually care about what they're writing. –  editor Mar 11 '11 at 1:41
    
Editor, I do care for what people write. I comment on almost, if not all responses. Some of my questions are still pending, I am very new to WP, that's why I am making beginner questions, but believe me I try to search the web before asking the question. I went ahead and marked the questions that are truly answered. Thanks for your honest feedback. –  Geo Mar 11 '11 at 2:58

2 Answers 2

  1. Determine your Multisite Blog ID. I will use 99 as an example
  2. Go into database
  3. Go to this table: wp_##_options (wp_99_options) - You will have a table for each blog.
  4. Find the record where "option_name" = "wp_user_roles"
  5. Change the text "wp_user_roles" to "wp_##_user_roles" ("wp_99_user_roles")

** the table you are editing will have option_id, blog_id, option_name, option_value, autoload. HOWEVER, DO NOT CHANGE ANY RECORD except the record where "option_name" = "wp_user_roles". There will only be a single record in this table like this.

** "wp_user_roles" is used when there is no multisite install, and here, it appears as though it was just a bug when the table was created.

share|improve this answer
    
Thank you! Life-saving advice here. This is EXACTLY the right answer. –  ZaMoose Sep 17 '11 at 16:48
    
I had NO "wp_user_roles" in my table, what I did was copying the content of wp_4_options>wp_user_roles (a large json object or a serialized array, I dunnow) to a new record called wp_5_options (this was the blog missing roles) and it fixed my problem. Voted +1 nonetheless because it put me on the right track –  Xananax Dec 15 '11 at 15:09
    
I resolved also REMOVING the record "wp_##_user_roles" from the main wp_options table, because it seems to override the one from wp_##_options. –  Paolo Feb 19 '13 at 9:36
    
Brilliant answer! –  jnthnclrk Aug 26 '13 at 15:36

If this is the problem I know so well, you are running a memcache setup behind your MU install? I've found that there's apparently a cache issue (witnessed in 2.9) for the options object where something good (like the wp_user_roles key) gets stuck in the "notoptions" memcache array.

If you do run atop memcache, and this sounds like a possiblity, try telnetting into the machine via 11211. Type delete blogid:options:notoptions, where the blogid is the id of the blog on which you see the issue. Refresh the admin panel and see if there are roles in the dropdown. If so, you've found your problem.

UPDATE: OK, so you did not find your problem -- you weren't running memcache. I would still check out the roles object, looking for a corrupt or non-existant one. I believe it's your best lead. You can use this code to dump the options table:

global $wpdb;
$array = $wpdb->get_col("SELECT option_name FROM $wpdb->options");
foreach ($array as $key) {
    echo $key . ": <code>";
    var_dump(get_option($key), true));
            echo "</code><br/>";
}
share|improve this answer
    
Editor. I don't know how memcache got into my server. I am not using it at all. Maybe because I installed w3 cache. I tried the delete it gave me a message saying not_found. I went ahead and disabled the memcache, since I am not using it. I am still having the issue. –  Geo Mar 11 '11 at 2:50
    
I'm sorry that wasn't a solution to your problem. I run into this one a lot so it was my best guess. I would keep looking into the roles object for that blog. Does it exist? Updated my answer above in hopes it will help. –  editor Mar 11 '11 at 18:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.