WordPress.org

Ready to get started?Download WordPress

Forums

User Role Editor
[resolved] Fatal error Multisite after 3.7 update (4 posts)

  1. joonymobile
    Member
    Posted 2 years ago #

    Fatal error: Call to a member function has_cap() on a non-object in /wp-content/plugins/user-role-editor/user-role-editor.php on line 186

    and i am using s2member plugin

    can you please help?

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

  2. kvera
    Member
    Posted 2 years ago #

    To me, (not on MU), it occurs when your're viewing the site without being logged-in. Because when a user isn't logged in the Global $wp_roles is empty.

    As a workaround, i had edited the user-role-editor.php,
    @line: 181 you'll have the ure_init() function.
    inside of it, the test for: if (!$role->has_cap(URE_KEY_CAPABILITY)) {
    i'd put that entire block inside a if, to test if we had a user logged in.

  3. Vladimir Garagulya
    Member
    Plugin Author

    Posted 2 years ago #

    That block of code is unneeded at all. My fault. I left it after some experiments with new functionality.

    if (!$role->has_cap(URE_KEY_CAPABILITY)) {
    ...
    }

    You see that the action inside is commented. Just remove it yourself or download updated user-role-editor.php from this link
    http://www.shinephp.com/wp-content/downloads/wordpress/plugins/user-role-editor-3-7-fast-fix.zip
    and replace this file inside user-role-editor plugin folder.

    Your feedback about testing results is very appreciated.

  4. joonymobile
    Member
    Posted 2 years ago #

    YEP it works now :) thanks Vladimir!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.