Can a plugin disable another plugin?

BleistivtBleistivt Moderator
edited August 2014 in Vanilla 2.0 - 2.8

Hi, is there an event, that gets fired very early, so you could overwrite config settings temporarily after they are loaded?

Basically I want a plugin to "turn off" another plugin temporarily as I'm trying to solve an incompatibility between these two without having to modify the other one.

Comments

  • You can turn off a plugin by setting the configuration setting to false. This isn't recommended as it will bypass any code a plugin needs/wants to execute before being disabled.

    You can temporarily set a configuration item by using SaveToConfig($Name, $Value, array('Save' => FALSE));.

    You can also hook into the plugin manager and unregister the plugin you don't like:

    public function Gdn_PluginManager_AfterStart_Handler($Sender) {
      $Sender->UnRegisterPlugin('PluginClassName');
    }
    

    I wouldn't really suggest doing either of these. Perhaps you can expand upon your issue and we can find a better way.

  • BleistivtBleistivt Moderator
    edited August 2014

    Thanks, I'm going to try that.

    My Problem: I'm using Consolidate, but it breaks the VanillaStats in the Dashboard in Firefox (not in Chrome though, seems to be more tolerant to malformed js):

    TypeError: rowStates is null
    Possibly an error with inline js code or the concatenation.

    Since it works well for the rest of my site and I don't really need it in the dashboard, I just wanted to use my utility-plugin to disable it in the dashboard.

  • peregrineperegrine MVP
    edited August 2014

    maybe you could check for dashboard controller and not load js or css that installed by plugin (either by a check on url or a check on controller. (I haven't looked at plugin, and I have not tested).

  • Any minifier has the potential to break things.

  • Consolidate does not minify.

    Please open a question under my plugin, if you are having issues.

  • Ok, I did some more research.

    The solution to my problem is kind of embarrasing: I had disabled third party cookies in Firefox, so VanillaStats did not work.

    I blamed it on Consolidate for a different issue (VanillaStats doesn't work when js is deferred).

Sign In or Register to comment.