Change ModuleInstallerInterface::install()/uninstall() method signature to expect single values instead of arrays.

Created on 20 June 2013, about 12 years ago
Updated 1 August 2025, about 1 month ago

Postponed until 8.1.x

Parent issue

πŸ“Œ [META] Improve the extension system (modules, profiles, themes) Active

Problem/Motivation

Refactor ModuleHandler::install()/uninstall() method signature to expect single modules instead of an array of modules. One of the reasons why ModuleHandler::install()/uninstaller() are so complex is that it currently expects an array of modules. However, there is no reason why it really has to as it would be just as good if it just expected a single module instead.

Internally, the only thing that justifies an array of modules is the post-installation hook invocation at the end of these methods which expects an array as well. However, that's really not an argument for keeping it as it is as that can easily be changed too which would also increase the DX in the hooks. Everything else in those methods is invoked in a foreach() loop anyways so we are not even talking about a regression as all the necessary rebuild steps during installation are invoked for every single item in the foreach() loop anyways.

Proposed resolution

Change ModuleHandlerInterface to expect single module names for installation/uninstallation. Possibly add another public method for installing multiple modules with a single function call which simply invoked $this->install($module); in a loop internally.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

other

Created by

πŸ‡¦πŸ‡ΉAustria fubhy

Live updates comments and jobs are added and updated live.
  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    We now install groups of modules anyway so I think we can probably close this.

    I'll give the original posters a chance to chime in though.

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    Yeah the module installer now takes arrays of modules so this is done, let's close as outdated.

Production build 0.71.5 2024