The package manager correctly prohibits users from disabling modules that are required. However, this feature can be made more user-friendly by showing the reason why the module is required.

If you look at the source of field_system_info_alter, for instance, you can see that that module writes the reason why the module is required to the info array.

      if ($non_deleted) {
        if (module_exists('field_ui')) {
          $explanation = t('Field type(s) in use - see !link', array('!link' => l(t('Field list'), 'admin/reports/fields')));
        }
        else {
          $explanation = t('Fields type(s) in use');
        }
      }
      else {
        $explanation = t('Fields pending deletion');
      }
      $info['explanation'] = $explanation;

If I'm not mistaken, this was added in Drupal 7.8.

Drush should display this value to the user. Currently, it just displays:

video is a required module and can't be disabled.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jorrit’s picture

Status: Active » Needs review
FileSize
1.33 KB

Attached a patch that changes the output to:

video is a required module and can't be disabled. Reason: Field type(s) in use - see Field list

jonhattan’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

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