Posted by heyrocker on
- Configuration of uninstalled modules may get orphan and persist forever, if a module does not manually delete all of its configuration.
- Automate removal of configuration upon uninstalling a module, as much as possible.
- Many Drupal sites contain plenty of orphan configuration variables belonging to modules that no longer exist.
- We should have a way to automatically uninstall configuration when a module is uninstalled without having to rely on the module's author implementing hook_uninstall().
- When a module is uninstalled, get a list of the configuration files it supplies by default.
- Scan through the live configuration directory and see if any of these files exist.
- If so, delete them.
- This would not catch any orphan live configuration objects, in case a module changes its default configuration objects over time. (assuming the module does not implement a module update that renames or delete the old configuration objects)
- This would also not clean up configuration created through other methods that depend on the module. For example:
- module Foo provides views.view.foo as a default view.
- views.view.foo gets moved to the live config directory when the module is installed.
- Now someone goes into the UI and creates a view called bar (views.view.bar) that depends on module Foo.
- When module Foo is uninstalled, the default view it provides would get cleaned up, but 'bar' view created through the UI would not.
PASSED: [[SimpleTest]]: [MySQL] 36,042 pass(es).
PASSED: [[SimpleTest]]: [MySQL] 35,843 pass(es).
FAILED: [[SimpleTest]]: [MySQL] 35,717 pass(es), 0 fail(s), and 3 exception(s).
PASSED: [[SimpleTest]]: [MySQL] 35,694 pass(es).