Support » Plugin: AdRotate » Disable plugin with bbpress activated isnt yet possible v3.8.4.1

  • Resolved alfredo49

    (@alfredo49)


    The new version (v.3.8.4.1) dont fix this problem, when i try to deactivate adrotate when bbpress plugin is activated, returns this error (and not desactivate):

    Warning: Invalid argument supplied for foreach() in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 548

    Warning: Invalid argument supplied for foreach() in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 548

    Fatal error: Call to a member function remove_cap() on a non-object in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 595

    http://wordpress.org/extend/plugins/adrotate/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Arnan de Gans

    (@adegans)

    I can’t really reproduce the issue here.
    With or without bbPress active it seems to work fine for me.

    Logically that would indicate a bug in bbPress messing up the user capabilities.
    Did you experiment with that?

    alfredo49

    (@alfredo49)

    i can deactivate bbpress without any problem also with adrotate active, the issue happens when i try to deactivate adrotate:

    2 cases happens:

    1) deactivate adrotate without any plugins active,returns this error 15 times more or less, but finally deactivates the plugin:

    Warning: Invalid argument supplied for foreach() in /usr/home/../wp-content/plugins/adrotate/adrotate-functions.php on line 548

    2) deactivate adrotate with bbpress active, return this error , but the plugin isnt deactivate:

    Warning: Invalid argument supplied for foreach() in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 548

    Warning: Invalid argument supplied for foreach() in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 548

    Fatal error: Call to a member function remove_cap() on a non-object in /usr/home/…/wp-content/plugins/adrotate/adrotate-functions.php on line 595

    Thx for support!

    Plugin Author Arnan de Gans

    (@adegans)

    Which version of WordPress do you use?

    alfredo49

    (@alfredo49)

    The last 3,5,1

    Plugin Author Arnan de Gans

    (@adegans)

    So have I,

    I’ll do some more digging, hopefully I am able to reproduce the issue so I can fix it 🙂

    alfredo49

    (@alfredo49)

    Thxs!

    Plugin Author Arnan de Gans

    (@adegans)

    Can you try something?

    I have learned that some wordpress sites do not have $wp_roles as a global.
    If your site is like that you need to create it before you can use it… Otherwise the error would show,

    Can you add this to line 546 (directly under global $wp_roles;

    if(!isset($wp_roles)) $wp_roles = new WP_Roles();

    If you save and upload the file with that extra line you should be able to disable AdRotate.

    Let me know how it goes 🙂

    alfredo49

    (@alfredo49)

    Hi:

    i add your code in this function (inside adrotate-functions.php):

    function adrotate_get_sorted_roles() {
    global $wp_roles;
    if(!isset($wp_roles)) $wp_roles = new WP_Roles(); //New Line
    $sorted = array();

    foreach($wp_roles as $roles) {
    foreach($roles as $role => $capabilities) {
    $sorted[$role] = get_role($role);
    }
    }

    $sorted = array_reverse($sorted);

    return $sorted;
    }

    i upload the file and Clean the cache, but i cant disable adrotate 🙁

    Repeat exactly the 2 cases of my previous post

    Plugin Author Arnan de Gans

    (@adegans)

    hmm 🙁

    alfredo49

    (@alfredo49)

    Important note!

    This issue happens since v3.8, in v3.7.4.3 and previous versions dont happen any of the mentioned cases

    Plugin Author Arnan de Gans

    (@adegans)

    But at the same time it works fine for me and many others… My search continues.

    alfredo49

    (@alfredo49)

    Thxs for support

    Plugin Author Arnan de Gans

    (@adegans)

    Can you check the following;
    If you go into AdRotate settings and all the way in the bottom enable “Show array of all userroles and capabilities” and save the settings.

    This should output some debug information on the settings screen. Look for a line like this:

    [DEBUG] Current User Capabilities

    What does it say directly below it? There should be a long list of all capabilities and roles your website has. Can you email me this list? info@ajdg.net

    http://www.adrotateplugin.com/support/forums/topic/cannot-deactivate-adrotate/

    alfredo49

    (@alfredo49)

    ok
    email send!

    Plugin Author Arnan de Gans

    (@adegans)

    Alfredo and I figured out the problem and a patch will be included with the next version.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Disable plugin with bbpress activated isnt yet possible v3.8.4.1’ is closed to new replies.