[Solved] Plugin Development Question - disable and removing settings glitch
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
-
peregrine MVP
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.
1
Answers
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.