WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
[resolved] Invalid argument (8 posts)

  1. richlondon
    Member
    Posted 2 years ago #

    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

    http://wordpress.org/extend/plugins/user-role-editor/

  2. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    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.

  3. richlondon
    Member
    Posted 2 years ago #

    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...

    a:1:{s:10:"subscriber";s:1:"1";}

  4. richlondon
    Member
    Posted 2 years ago #

    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.

  5. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    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
    http://www.shinephp.com/how-to-change-wordpress-user-role-capabilities/
    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.

  6. richlondon
    Member
    Posted 2 years ago #

    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!

  7. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    That's interesting. If such, something needs to be fixed.
    Send screenshot to vladimir [at-sign] shinephp.com
    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.

  8. richlondon
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic