Support » Plugin: User Role Editor » [Plugin: User Role Editor] Invalid argument

  • Resolved richlondon


    I have tried to export from a wordpress site, and import them into a new wordpress site.

    I get this error, the edit roles screen.
    Warning: Invalid argument supplied for foreach() in C:\inetpub\wwwroot\wp-content\plugins\user-role-editor\ure-lib.php on line 368

    this appears for each user that has this role assigned to it on the previous site.
    AS I add roles to match the older site the list gets bigger.
    the other issue is the that users don’t appear on the users screen in wordpress…..

    does any bidy have any ideas as to why this is?

    many thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Vladimir Garagulia


    What data did you export/import?
    It seems that you have invalid data in the wp_usermeta Db table. Check
    records with meta_key wp_capabilities it should have meta_value as serialized array of this kind ‘a:1:{s:10:”subscriber”;s:1:”1″;}’
    Line 368 in ure-lib.php tries to work with such unserialized array, but with fault in your case.

    I have exported and imported the users again, I have set all the users’ role to subscriber. I haven’t created the second site yet that some of the users were registered to in the previous install (dont’ know if that was would be an issue…

    After much reseraching on which export and import plugins to use, I ended up just pulling in the basic info… username, firstname, lastname, email address, wesbite.

    I have discovered that this error only appears when I have logged out of the site.

    I have looked at the user meta for one of the users. There array is like this…


    I have had to create the custom roles again, that some of the users had. Could it be that the plugin (because of the imprt of data) is confused between the old rol names and the new role names?

    Is there a table somewhere in teh db that lists all teh roles, or custom roles at least, or are they just referenced in the user meta?

    dunno just an idea.

    Plugin Author Vladimir Garagulia


    Did you export-import usermeta table with users table together?
    If you did not, then some of imported users have not required records at the usermeta table, including the wp_capabilities one.

    You can see this error at the URE page only, but this page is accessible for you logged in as admin. How can you see it after logout? Is it possible to show the screen-shot?

    I assume that URE is confused with some data corrupted after import. Does WordPress itself works correctly with roles, and doesn’t show any errors?

    Read this post
    in order to know where and how WordPress stores its roles and capabilities. URE plugin works with WordPress standard data storage and doesn’t use any own db tables.

    It appears on every page at the front end of the site.
    where can I post s screenshot?

    Do i need to look through the wp-usermeta and compare it to the wp-user, to make sure that the user ID’s match up? I’m sure me and the it admin, made sure this was all corerct.

    thanks for the quick reply!

    Plugin Author Vladimir Garagulia


    That’s interesting. If such, something needs to be fixed.
    Send screenshot to vladimir [at-sign]
    Also send me exported wp_users with empty ‘password’ field to not compromise it, wp_usermeta and wp_options tables data. I will try to reproduce your situation at my test environement.

    I have emailed the stuff to you…hopefully you should have received it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: User Role Editor] Invalid argument’ is closed to new replies.