Issue #1854: Allow uninstall of dependent modules. #2566

Merged
merged 3 commits into from Feb 14, 2017

Projects

None yet

3 participants

@danepowell
Contributor

Currently, there is no way to uninstall modules that depend on one another because Drush checks the dependency chain for each module individually, without considering any of the other modules you are uninstalling.

It's also counterintuitive that although Drupal's core ModuleInstaller::uninstall() function automatically uninstalls dependent modules, Drush (which ultimately just uses the same function) won't let you do the same thing.

Drush should automatically uninstall depending modules, same as core. I can't imagine a scenario where the current behavior is desired. The only argument I could imagine against this is that there's a small performance hit to computing the dependency chain... but we are already incurring that hit by not passing a second parameter to ModuleInstaller::uninstall().

This is a regression introduced by #925, which ostensibly had nothing to do with checking module dependencies.

@danepowell danepowell Issue #1854: Allow uninstall of dependent modules.
91a7d4a
@jonhattan jonhattan was assigned by weitzman Jan 24, 2017
@weitzman
Member

Thanks for the PR. Hopefully @jonhattan will get a chance to look into this bug.

@danepowell danepowell Updated documentation.
1738660
@weitzman
Member
weitzman commented Feb 8, 2017

Others are welcome to review/test this. @jonhattan is quite busy.

@weitzman
Member

Related #2494

@weitzman
Member
weitzman commented Feb 13, 2017 edited

Will the confirmation show the dependant modules that will also be removed? If so I think this makes sense to merge.

@danepowell
Contributor

No this won't list dependencies. If we want to do that, we would have to manually compute the dependency chain and pass false as the second parameter to drush_module_uninstall.

I think it would be good to merge this as-is and open a follow-up issue to make that change, since the current situation is pretty bad (completely impossible to uninstall any modules with dependencies).

@danepowell
Contributor

Actually it might not be so hard to make that change, since the existing code already builds the dependency chain, I'll try to take a look later today.

@danepowell danepowell List all modules to be uninstalled.
a5c82c0
@danepowell
Contributor

Okay this should list all modules (including dependencies) that will be uninstalled.

@weitzman weitzman merged commit f7167cc into drush-ops:master Feb 14, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@weitzman
Member

Worked for me. Thanks a lot @danepowell

~/reps/drushbare (2566) $ ./drush  -r ~/reps/d8 pmu file
The following extensions will be uninstalled: file, update
Do you really want to continue? (y/n): y
 [ok] file was successfully uninstalled.
 [ok] update was successfully uninstalled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment