Uninstalling the module leaves behind dirty config in any filter format that codesnippet was enabled for. This means that coming back and enabling the module later will restore all previous config.

Expected behavior when uninstalling should be to clean up data from editor configuration.

When uninstalling the module:

  • CodeSnippet plugin settings should be removed from editor settings
  • CodeSnippet toolbar button should be removed from editor settings
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kevinquillen created an issue. See original summary.

kevinquillen’s picture

FileSize
1.24 KB

Attaching patch.

Uninstalling the module has the intended result, codesnippet settings are removed and so is the toolbar button.

Is there a better way at reaching in and removing the button from the settings?

kevinquillen’s picture

Status: Active » Needs review
kevinquillen’s picture

Status: Needs review » Needs work
kevinquillen’s picture

kevinquillen’s picture

Attaching updated patch.

I changed it so hook_uninstall calls a function to clean up the plugin from editor configurations instead. There may be other cases for 'flushing' plugin configuration from filter configuraiton without needing to uninstalling the module. I have ran into a few instances when developing the module where the config in the filter format gets dirty from an error, and then there is no way to 'clean' it without starting over.

It would be great if you could reset a core format back to its initial state at the click of a button. At the very least maybe an admin page that lets you select the filter, and then the plugin, to clear from it. The code is still similar.

James Nesbitt’s picture

Status: Needs work » Needs review
borisson_’s picture

Status: Needs review » Reviewed & tested by the community
+++ b/codesnippet.module
@@ -53,3 +53,39 @@ function codesnippet_preprocess_html(&$variables) {
+    if ($editor->getEditor() != 'ckeditor') {

Can be strict compare.

This is however not required, and I think it would be helpful to have this in, setting to rtbc based on the code in the patch.