Title: Undefined Offset: 0
Last modified: September 1, 2016

---

# Undefined Offset: 0

 *  [weslinda](https://wordpress.org/support/users/weslinda/)
 * (@weslinda)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/)
 * Getting this error on our site. Unsure of what we’re missing here.
 * Undefined offset: 0 in /home/sitename/public_html/wp-content/plugins/stream/connectors/
   class-connector-users.php on line 210
 * We are using the Members plugin to add/develop roles. We are using another plugin
   to handle login of users and defining of roles on login. This error seems specifically
   related to the roles of a user.
 * Can you assist?
 * [https://wordpress.org/plugins/stream/](https://wordpress.org/plugins/stream/)

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

 *  [Luke Carbis](https://wordpress.org/support/users/lukecarbis/)
 * (@lukecarbis)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537318)
 * Hi weslinda,
 * The error is related to the return value of the [set_user_role](https://codex.wordpress.org/Plugin_API/Action_Reference/set_user_role)
   function. On most installs it returns the user’s previous roles, but it doesn’t
   seem to be doing that for you.
 * Could you please try editing your `connectors/class-connector-user.php` file,
   and replacing the `callback_set_user_role` method with this one: [https://gist.github.com/lukecarbis/2456444da101b0e96b486590a9b5f397](https://gist.github.com/lukecarbis/2456444da101b0e96b486590a9b5f397)
 * If that helps, I’ll include it in our next release.
 *  Thread Starter [weslinda](https://wordpress.org/support/users/weslinda/)
 * (@weslinda)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537320)
 * It doesn’t seem to have fixed it. I can get past the error if I turn off debug
   but it seems to cause a few issues once that picks up. Perhaps it’s because we’re
   using a plugin that generates a new role ON registration?
 * We’re using a plugin by miniorange that allows us to connect with SSO/Shibboleth
   on our network. That plugin creates a user & sets their role as a new role utilizing
   the Members role plugin I mentioned above. So basically, I’ve made a role beyond
   the standard roles so I can control content. Then when a user logs into the site
   with their corporate login for the first time a, a new user is created and assigned
   to a specific role that isn’t one of the standard WordPress roles.
 *  [Luke Carbis](https://wordpress.org/support/users/lukecarbis/)
 * (@lukecarbis)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537325)
 * Can you go back to that method, and right after the `$old_roles = array_values(
   $old_roles );` line, add this:
 * `var_dump( $old_roles );`
 * That should give you some additional output, which you can copy and paste in 
   here for me.
 *  Thread Starter [weslinda](https://wordpress.org/support/users/weslinda/)
 * (@weslinda)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537326)
 * array(1) { [0]=> string(10) “subscriber” }
 * is the additional information provided
 *  [Luke Carbis](https://wordpress.org/support/users/lukecarbis/)
 * (@lukecarbis)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537328)
 * Are you sure that the error is still the same? It doesn’t make sense that in 
   the output you gave, the [0] offset _is_ defined, but the error is telling you
   that it isn’t. Maybe you could post a screenshot of the error?

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

The topic ‘Undefined Offset: 0’ is closed to new replies.

 * ![](https://ps.w.org/stream/assets/icon.svg?rev=3128015)
 * [Stream](https://wordpress.org/plugins/stream/)
 * [Support Threads](https://wordpress.org/support/plugin/stream/)
 * [Active Topics](https://wordpress.org/support/plugin/stream/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stream/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stream/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Luke Carbis](https://wordpress.org/support/users/lukecarbis/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/undefined-offset-0-4/#post-7537328)
 * Status: not resolved