Problem/Motivation
We support install profiles, to customize the installation experience to some degree.
And we support installing Drupal from a recipe, bypassing the profile entirely.
But what we don't yet support is the in-between zone: you want to customize the install experience, but you also want to apply a recipe (or set of recipes) at install time. This grey zone is where Drupal CMS exists, and it needs to do some hacky workarounds to make that possible.
Proposed resolution
Allow a profile's info file to specify a list of recipes that should be applied once modules are installed. These recipes would be applied in the order they are listed, by appending their batch operations to the ones from install_profile_modules.
User interface changes
None.
Introduced terminology
None.
API changes
A new recipes key would be supported in profile info files.
Release notes snippet
TBD
Issue fork drupal-3605549
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
phenaproximaAdded this new ability, and a basic test to prove it works with core recipes.
The main missing thing here is path resolution. Core recipe paths are used as-is, but if we add this ability, then we need to resolve recipe directory paths relative to...somewhere. How should we handle that? A few possibilities:
drupal/recommended-projectlayout, the paths would be listed as../recipes/foo. This is the simplest, but it means profiles using this superpower would be tightly coupled to the project layout.drupal-recipepackages will be installed, and resolve relative to that. This is what Drupal CMS does, and is probably the most robust choice.$install_state['recipes_directory']variable, defaulting to../recipes. This could be overridden programmatically by callinginstall_drupal()directly, or by a custom profile which does a similar thing. This is probably the most lightweight "configurable" option, since $install_state is already a hodgepodge of various state flags used only by the installer.$install_state['profile_info'].Or maybe something else?
Comment #4
gábor hojtsyThis also needs to take into account translation at one point. If not here then modified later to do it :) That the recipe should get its translation file downloaded prior to being applied. The data from such .po file is not currently used but will be after #3472317: Config language adaptation and translation does not happen at all when config is applied from a recipe.
Comment #5
gábor hojtsyAnyway recipes do not support that yet, so we can get this in like so, I think its quite simple and elegant and well tested :)
Comment #6
gábor hojtsy