1

During install we create content types, field storages and vocabularies. When uninstalling none of these things are uninstalled.

I know that we can set all the configuration to have the module as dependency, but that is tedious to do; is there a better way to let Drupal uninstall all the configuration on the module in the config/install folder?

  • You would have to uninstall the node and taxonomy modules :D – user21641 Jan 9 '17 at 11:00
  • That's not true – Kevin Jan 9 '17 at 16:16
3

I know that we can set all the configuration to have the module as dependency, but that is tedious to do; is there a better way to let Drupal uninstall all the configuration on the module in the config/install folder?

Not really. Deleting the configuration is just as tedious, as you need to know what's yours. you could solve it using a naming pattern and list all node types, fields, views, .. starting with yourmodule_ I guess.

There's been some discussion to automatically add the module providing the configuration as an enforced dependency, but that's actually also not always what you want.

1

One of the answers here may be able to help:

How do I remove a configuration object from the active configuration?

At a starting point, you could add hook_uninstall and run through and delete config, although, you will want to test this to ensure other parts of your site are unaffected after uninstalling.

This answer in particular may also work for you: https://drupal.stackexchange.com/a/173898/57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.