Skip to content
Snippets Groups Projects

Treat required recipes as installed, every time

Open Adam G-H requested to merge issue/drupal-3477329:3477329-recipe-required-modules into 11.x
2 unresolved threads

Closes #3477329

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
383 383
384 384 $configurator = new RecipeConfigurator($recipe_being_validated['recipes'] ?? [], $include_path);
385 385
386 /** @var \Drupal\Core\Extension\ModuleExtensionList $module_list */
387 $module_list = \Drupal::service('extension.list.module');
386 388 // The config provider must either be an already-installed module or theme,
387 389 // or an extension being installed by this recipe or a recipe it depends on.
388 390 $all_extensions = [
389 ...array_keys(\Drupal::service('extension.list.module')->getAllInstalledInfo()),
391 ...array_keys($module_list->getAllInstalledInfo()),
390 392 ...array_keys(\Drupal::service('extension.list.theme')->getAllInstalledInfo()),
391 393 ...$recipe_being_validated['install'] ?? [],
392 394 ...$configurator->listAllExtensions(),
393 395 ];
396 // Required modules should always be considered considered installed, which
  • 385 385
    386 /** @var \Drupal\Core\Extension\ModuleExtensionList $module_list */
    387 $module_list = \Drupal::service('extension.list.module');
    386 388 // The config provider must either be an already-installed module or theme,
    387 389 // or an extension being installed by this recipe or a recipe it depends on.
    388 390 $all_extensions = [
    389 ...array_keys(\Drupal::service('extension.list.module')->getAllInstalledInfo()),
    391 ...array_keys($module_list->getAllInstalledInfo()),
    390 392 ...array_keys(\Drupal::service('extension.list.theme')->getAllInstalledInfo()),
    391 393 ...$recipe_being_validated['install'] ?? [],
    392 394 ...$configurator->listAllExtensions(),
    393 395 ];
    396 // Required modules should always be considered considered installed, which
    397 // allows the recipe to be valid even during the early installer.
    398 foreach ($module_list->getAllAvailableInfo() as $name => $info) {
    399 if (!empty($info['required'])) {
    • (Optional) TIL about the "required" key, I had to look it up as info files generally don't have this key, might be worth rewording the comment like "Required modules will always be installed..." or similar

    • I think its good that info files generally don't have required: true! There are only a handful of core modules that need it. I think the comment is appropriate.

    • Please register or sign in to reply
  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Adam G-H added 1 commit

    added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading