If hidden modules are enabled (modules whose .info files have the line "hidden = TRUE"), and Drush is used to enable or disable other modules, errors are thrown:
$ drush pm-disable -y my_normal_module
The following extensions will be enabled: my_normal_module
Do you really want to continue? (y/n): y
WD form: Illegal choice my_hidden_module in status element. [error]
my_normal_module was disabled successfully. [ok]
An illegal choice has been detected. Please contact the site administrator. [error]
This is happening because drush_system_modules_form_submit() is being called with a list of modules which includes the hidden modules. Since that system form isn't expecting the hidden modules, it complains.
I've attached a patch which addresses this issue by adding a flag to pm_module_list() to specify that it should not include hidden modules, and enabling this flag when generating module lists for drush_system_modules_form_submit().
| Comment | File | Size | Author |
|---|---|---|---|
| drush-pm-hidden-modules-00.patch | 1.51 KB | smokris |
Comments
Comment #1
moshe weitzman commentedDo we still have to call drush_system_modules_form_submit(). I think we cleaned this up in D7 at least so thats not needed unless a module is really doing odd/unsupported stuff.
Comment #2
fuzzy76 commentedSeeing this on D6 with features
Comment #3
jonhattanI think it is safe to remove the form submission for D7 as module_enable invokes
hook_module_installedandhook_module_enabledis available for other modules to hook and do their job.@fuzzy76 this same issue won't happen in D6.
Comment #4
jonhattanFixed in http://drupalcode.org/project/drush.git/commit/6a73efe
Comment #5
smokrisThanks, but that doesn't completely solve the problem — the error messages mentioned in the original post came from a Drupal 6 site.
In #3, you said it won't happen in D6. Could you elaborate?
Comment #6
jonhattanSorry I thank hidden modules were introduced in drupal 7 but it seems not.
Comment #7
jonhattanI've refactored drush_get_extensions() / modules / themes to optionally exclude hidden modules. Several parts of drush do benefit of this and the fix for this issue is "slightly" different.
http://drupalcode.org/project/drush.git/commit/d3516b7
Comment #8
smokrisAwesome. Thanks, @jonhattan!
Comment #9
smokris(Ugh, I didn't mean to re-open the issue. Sorry about that.)