Skip to content

pm:enable should be pm:install #4588

Closed
Closed

Description

@jhodgdon-drp

Describe the bug
In Drupal 8.x and above, there is no longer a way to "enable/disable" modules. Instead we "install/uninstall" them.

However, Drush still has a pm:enable command along with pm:uninstall.

This is confusing (enable is the opposite of uninstall?) and inconsistent with the Drupal UI.

To Reproduce
List commands in Drush and you'll see that pm:enable turns a module on, and pm:uninstall turns it off (which also involves adding/removing configuration, database tables, and/or content).

Expected behavior
The pm:enable command should be named pm:install for consistency with the Drupal UI and with the pm:uninstall command.

System Configuration

Q A
Drush version? 10.x
Drupal version? 9.x/8.x
PHP version any
OS? any

Additional information
Drupal core issue about making the Drupal UI more consistent in this area:
https://www.drupal.org/project/drupal/issues/2891294
which is part of a meta issue:
https://www.drupal.org/project/drupal/issues/2888657

Activity

  1. greg-1-anderson commented on Nov 13, 2020

    @greg-1-anderson
    Member

    +1 we can keep pm:enable as an alias, so there is little cost to doing this.

  2. weitzman commented on Dec 5, 2020

    @weitzman
    Member

    Yeah, this is a good proposal ... The docs web page will change url. We could add a redirect plugin for mkdocs if we want to avoid a few 404s.

  3. rajeshreeputra commented on Feb 2, 2022

    @rajeshreeputra
    Contributor

    I have create PR #5061
    Also kept alias "install, pm-install, en, pm-enable, pm:enable" for pm:install
    @weitzman could you please review changes in PR.

    I have tested this on local and confirming that below all commands are working fine, as expected.

    drush en
    drush pm-enable
    drush pm:enable
    drush install
    drush pm-install
    drush pm:install
    
  4. gitressa commented on Apr 16, 2022

    @gitressa
    Contributor

    This is an improvement, but for consistency, shouldn't we also add an un alias for pm:uninstall, just as pm:install has in?

    pm:install

    Aliases: in, install, pm-install, en, pm-enable, pm:enable
    

    pm:uninstall

    Aliases: pmu, pm-uninstall
    
  5. gitressa commented on Apr 16, 2022

    @gitressa
    Contributor

    I created a PR which adds a un alias, #5131.

    $ drush | grep pm:uninstall
      pm:uninstall (un, pmu)      Uninstall one or more modules and their dependent modules.
    
    $ drush un diff
     [success] Successfully uninstalled: diff
    
  6. added a commit that references this issue on Jan 27, 2024
    3cfabb5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions