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

  1. joonymobile
    Posted 4 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?


  2. kvera
    Posted 4 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
    Plugin Author

    Posted 4 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
    and replace this file inside user-role-editor plugin folder.

    Your feedback about testing results is very appreciated.

  4. joonymobile
    Posted 4 years ago #

    YEP it works now :) thanks Vladimir!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Role Editor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.