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().

CommentFileSizeAuthor
drush-pm-hidden-modules-00.patch1.51 KBsmokris

Comments

moshe weitzman’s picture

Assigned: Unassigned » jonhattan

Do 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.

fuzzy76’s picture

Seeing this on D6 with features

jonhattan’s picture

Status: Needs review » Needs work

I think it is safe to remove the form submission for D7 as module_enable invokes hook_module_installed and hook_module_enabled is available for other modules to hook and do their job.

@fuzzy76 this same issue won't happen in D6.

jonhattan’s picture

Status: Needs work » Fixed
smokris’s picture

Status: Fixed » Active

Thanks, 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?

jonhattan’s picture

Sorry I thank hidden modules were introduced in drupal 7 but it seems not.

jonhattan’s picture

Status: Active » Fixed

I'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

smokris’s picture

Status: Fixed » Active

Awesome. Thanks, @jonhattan!

smokris’s picture

Status: Active » Fixed

(Ugh, I didn't mean to re-open the issue. Sorry about that.)

Status: Fixed » Closed (fixed)

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