Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] Plugin Development Question - disable and removing settings glitch

peregrineperegrine MVP
edited March 2012 in Vanilla 2.0 - 2.8

I have a plugin under development, but not yet posted, that has a settings option for several questions.

I have several problems:

1) I can't seem to get it to disable when I click the disable button, the only way to disable is manually remove from config.php. Any ideas why I can enable but not disable (it seems the behavior is slightly different when settings are used).

2) how would I go about removing a plugin setting option line (any command)
e.g. $Configuration['Plugins']['MyPlugin']['Setting One'] = '1';

3) How do I display a remove button, It seems that enable and disable are automatically created. Is remove button automatically created. or is there a command.

4) I can't find any examples of question 2, because I haven't seen a plugin that removes its debris

other than $Configuration['EnabledPlugins']['MyPlugin'] = TRUE; ).
There seems to be no database table cleanup in most if not all plugins that are removed.

I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Best Answer

  • peregrineperegrine MVP
    Answer ✓

    Not sure how to accept my own answer - but it is solved.

    1) solved - make sure the directory name is the same name as the plugin - if you have a type in the directory name it will look as if enabled and you won't be able to disable.

    2) answer - RemoveFromConfig('Plugins.MyPlugin.Setting_One');

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Answers

  • peregrineperegrine MVP
    Answer ✓

    Not sure how to accept my own answer - but it is solved.

    1) solved - make sure the directory name is the same name as the plugin - if you have a type in the directory name it will look as if enabled and you won't be able to disable.

    2) answer - RemoveFromConfig('Plugins.MyPlugin.Setting_One');

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.