Allow a distribution to ship with multiple installation profiles (of which one can be selected in the installer)

Created on 1 February 2014, almost 11 years ago
Updated 30 January 2023, almost 2 years ago

Goal

  1. As a distribution author, I want to be able to ship with multiple installation profiles, so that the user is able to select a profile (out of my distribution only) in the installer.

Details

  • The goal of a distribution that ships with multiple profiles is to

    1. take over the installer
    2. still allow to choose a profile
    3. but only out of profiles that belong to the distribution.

Proposed solution A: distribution.info.yml

  1. Introduce a distribution.info.yml outside of any installation profile directory in a fixed location, possibly the root directory.

  2. Adjust the installer to (1) check whether that file exists, and if it does (2) skip the logic of preselecting a distribution profile and instead, (3) consult that info file for installer settings instead.

  3. Adjust the drupal.org release packaging script to move the file from the installation profile folder into the root folder in the tarball.

    Note: Obviously adds a dependency on drupal.org's specific release packaging script. Whether that is a good idea is debatable.

Proposed solution B: Tag mapping

  1. Implement a simple taxonomy-alike tag mechanism: Two or more profiles that have the same project (package) tag belong together.

    /core/profiles/minimal.info.yml:        project: drupal
    /core/profiles/standard.info.yml:       project: drupal
    /core/profiles/zero.info.yml:           project: drupal
    /profiles/portfolio.info.yml:           project: portfolio
    /profiles/commerce.info.yml:            project: commerce
    /profiles/commerce_kickstart.info.yml:  project: commerce
    

    The "project" info file property is added by drupal.org packaging scripts already today. It can be added and committed manually to the info files.

  2. The (one) installation profile that specifies the 'distribution' property in its info file takes over the installer.
    cf. #1351352-33: Distribution installation profiles are no longer able to override the early installer screens

    An example:

    1. If the "commerce" profile specifies the 'distribution' property, then "commerce" takes over the installer.
    2. The user can choose between the "commerce" and "commerce_kickstart" profiles, because the project tag of both is "commerce".
    3. "commerce_kickstart" does not take over the installer, because it does not specify the 'distribution' property and thus is only a "secondary" profile option in the package.
  3. Implement the following simple algorithm in the installer:

    // The profile that defines 'distribution' takes over the installer.
    if ($preselected_distro_profile) {
      // Retrieve its project tag/package.
      $package = $preselected_distro_profile->info['project'];
      // Filter all available profiles by its tag.
      $profile_choices = array_filter($profiles, function ($profile) use ($package) {
        // Remove all profiles that do not belong to the same package/project.
        return $profile->info['project'] == $package;
      });
      // If there is only one profile in the distro/package, no profile selection will appear.
    }
    // Otherwise, regular Drupal installer, because there is no distribution profile.
    else {
      $profile_choices = $profiles;
    }
    

Notes

  1. This facility is not to be mistaken with installation profile inheritance à la base themes:
    #1356276: Allow profiles to define a base/parent profile
Feature request
Status

Needs work

Version

10.1

Component
Install 

Last updated 7 days ago

No maintainer
Created by

🇩🇪Germany sun Karlsruhe

Live updates comments and jobs are added and updated live.
  • distributions

    Used in Documentation issues for documentation of distributions

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Production build 0.71.5 2024