It would be really useful, especially when using Features (#1009370: How to enable new dependencies without going to admin/build/modules?) or when modules are refactored, if there was a flag for pm-enable / en to enable any currently disabled dependencies.

CommentFileSizeAuthor
#6 drush-1105642.patch1.54 KBjonhattan
#5 drush-1105642.patch964 bytesjonhattan

Comments

moshe weitzman’s picture

how does drupal core handle newly added dependencies? this is sort of tricky.

greg.1.anderson’s picture

As a workaround, how about drush dis modulename && drush en modulename?

damienmckenna’s picture

What if disabling a module brings a huge array of consequences?

moshe weitzman’s picture

None of those consequences should entail data loss (thats what uninstall is for) - but I agree. Not a wise path.

How about we enhance pm-enable such that it works for already enabled extensions. Namely, it actually calls module_enable() and thus any new dependencies as enabled. would work on D7 at least.

jonhattan’s picture

Status: Active » Needs review
StatusFileSize
new964 bytes

That's one small step for a man, ...

example:

$ drush en email
The following extensions will be enabled: email
Do you really want to continue? (y/n): y
email was enabled successfully.                                                                                                                   [ok]

$ echo "dependencies[]=text" >> modules/email/email.info 

$ drush en email
email is already enabled.                                                                                                                         [ok]
The following extensions will be enabled: text
Do you really want to continue? (y/n): y
jonhattan’s picture

StatusFileSize
new1.54 KB

polished

greg.1.anderson’s picture

Status: Needs review » Reviewed & tested by the community

Well done.

jonhattan’s picture

Assigned: Unassigned » msonnabaum
Status: Reviewed & tested by the community » Patch (to be ported)

Committed. Perhaps Mark wants this in 4.x

jonhattan’s picture

Version: » All-versions-4.x-dev
msonnabaum’s picture

I really like this patch, but I'm on the fence about whether this is safe to backport because it does change behavior.

I could use a second opinion on this if anyone else has a different take.

greg.1.anderson’s picture

I think it is okay to backport; it extends old behavior, should not break any existing scripts or code.

msonnabaum’s picture

Status: Patch (to be ported) » Fixed

k, backported.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.