Allow uninstalling modules with dependents by offering to recursively uninstall their dependents as well.

Created on 20 May 2009, about 16 years ago
Updated 20 July 2023, almost 2 years ago

Problem/Motivation

Much like we force dependent modules to be enabled, it would be handy to be able to disable a module and its dependencies recursively. When there are several dependencies between modules, several successive rounds of disabling modules are required which takes a really considerable amount of time and makes the whole procedure tedious.

Proposed resolution

These two options are discussed:

A. Use Javascript to:

1) when a user clicks on a checked-disabled check box, enable and uncheck it, then recursively uncheck all modules which depend on that module and then all modules which depend on the modules which were just unchecked, etc. Could also display a popup message informing the user that unchecking this module will cause the following modules to be unchecked as well.

and/or

2) when a user unchecks a module, check if there are any modules which it requires and enable their check box, if possible.

B. Don't disable any check boxes on the form, and then when the form gets submitted, check if there are any additional modules which will need to be disabled and then ask the user if they would like to continue. Similar process to enabling module dependencies.

Remaining tasks

After enough discussion, the general consensus is to try and have as much consistency with the way things are done now when enabling modules that have dependencies. So we need to go with option B mentioned above where basically, when you click submit, Drupal would now tell you two things and get you to confirm that the following modules will be enabled and disabled:

1) List of modules which will now be enabled because they are dependencies for modules you want to enable.

2) List of modules which will now be disabled because 1 or more of the modules they depend on are being disabled.

Latest patch available for testing is in comment #21 below.

Related issues

#107038: Javascript to select module dependencies

User interface changes

Any module can be selected to be disabled on the modules page (besides the always required core modules such as node and user). After submitting the page a confirmation is required to disable possible dependant modules.

API changes

none.

Original report by NancyDru

// Text of original report:

Much like we force dependent modules to be enabled, it would be might handy to be able to disable a module and its dependencies. I just went to disable Update (in this case, but it's not important which one) because of a problem I'm debugging and there were two levels of dependencies that meant I had to disable 3 times - way too much overhead.

Feature request
Status

Needs work

Version

9.5

Component
Extension 

Last updated about 18 hours ago

No maintainer
Created by

🇺🇸United States nancydru Boston

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Postponed: needs info 12 days ago
  • 🇺🇸United States nicxvan

    Adding some related issues, one is closed as a duplicate of this.

    This issue was first about disabling and pivoted without much discussion to uninstall once disabling went away.

    I'm going to postpone this and copy my comment from the related issue:

    Postponing this only because uninstall can be destructive. I think manually checking the dependency tree is important.

    Imagine we add this then someone uninstalled system, suddenly their site is just gone.

    I think I would need a very convincing argument that the convenience of single step uninstall is outweighs the risks of accidentally uninstall to many modules.

  • 🇺🇸United States nicxvan
Production build 0.71.5 2024