In both the new plugin manager and the module listing page, we need a way, from a user perspective, to "enable a project". Right now, we can't "enable a project" in the general case, because projects are not required to provide a module named after the project (for example CCK and Ubercart do not have modules named CCK and Ubercart).

Furthermore, it may be hard for people to figure out exactly which modules do what in a project. Offering developers a way to point their users in the right direction would be a usability improvement. It's also the only way that the plugin manager can do anything significant when installing a project, without adding yet another prompt. Similarly, there has been discussions on ways to quickly enable a project directly in the module listing page (in #538904: D8UX: Redesign Modules Page).

I think we should dismiss the idea of implementing it in a project-level metadatafile (see #568288: provide a project meta information file): we already have metadata files for modules, we don't need one for the project simply to fulfill that one requirement here.

An alternate solution could be to add a parameter to the module.info files flagging those modules as default or prioritize them in some way. We could have something like:

name = Devel
description = Various blocks, pages, and functions for developers.
package = Development
dependencies[] = menu
core = 6.x
priority = high

(Here, priority = high would mean that the module would be enabled by default. Priority = medium would mean the project would show up, but would be optional and priority = low would mean the module is basically library code that the user is likely to never see. just an idea.)

Another alternative would be to simply enforce a naming convention: enable the module named after the project when installing or "enabling" a project. Dependant modules would be enabled along and everything would be fine. Part of porting to D7 would be to follow that convention, modules would have to be renamed and dependencies would be managed accordingly. For example, the cck and ubercart projects would provide modules named CCK and ubercart that could just be dependency stubs for the right modules.

Those are just suggestions of the possible implementation, but I think we first need to agree that we need to have that distinction between modules within a project. This is why I am opening this issue separately from #568288: provide a project meta information file, which is too focused on a specific technical solution.

To sum up, I have heard of 4 separate implementation proposals here:

* project-level metadata (no other use case, #568288: provide a project meta information file)
* drupal.org settings available through update_status hooks (requires connectivity)
* metadata stored in already existing metadata files ("priority", proposed above)
* just enable the module named after the project (my suggested implementation above)

In my opinion, the naming convention is the cleanest and most elegant solution.

This issue stems from discussions around #568288: provide a project meta information file, #538660: Move update manager upgrade process into new authorize.php file (and make it actually work) and #538904: D8UX: Redesign Modules Page. A quick review of those issues is recommended before posting here. I would also recommend people to keep to constructive criticism, patches or alternatives implementation when commenting on this thread.

Comments

JacobSingh’s picture

I like the idea of a "Primary" module okay, but not enabling defaults via dependencies. Those are not dependencies, and cannot be treated as such.

Also, there are cases, like Ubercart, where having a "Ubercart" module makes no sense. Still, I think that's not a big problem. if we do a "main" module, would need to change the info file I think to support default_modules or something.

Best,
Jacob

stephencamilo’s picture

Status: Active » Closed (won't fix)
hestenet’s picture

Status: Closed (won't fix) » Active

Reset issue status.

apaderno’s picture

Title: have a way to specify modules to be enabled by default when a project is installed » Add a way to specify modules to be enabled by default when a project is installed
Version: 7.x-dev » 10.0.x-dev

This is too late for Drupal 7. It should eventually be implemented in Drupal 10.

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.