Problem/Motivation

Split off as a follow-up from https://git.drupalcode.org/project/drupal/-/merge_requests/14902#note_80... where @longwave writes:

Out of scope but this feels like we need a ConfigImporterFactory to inject these for us.

This is in reference to this fun in core/lib/Drupal/Core/Recipe/Command/RecipeCommand.php:

$config_importer = new ConfigImporter(
      $storage_comparer,
      $container->get('event_dispatcher'),
      $container->get('config.manager'),
      $container->get('lock'),
      $container->get('config.typed'),
      $container->get('module_handler'),
      $container->get('module_installer'),
      $container->get('theme_handler'),
      $container->get('string_translation'),
      $container->get('extension.list.module'),
      $container->get('extension.list.theme'),
    );

Steps to reproduce

Proposed resolution

Use our existing ConfigImporterFactory that Does The Right Thing(tm).

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3587725

Command icon 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

dww created an issue. See original summary.

mradcliffe’s picture

Issue tags: +Recipes initiative

I'm tagging for recipe initiative since this is also related to the recipe command.

longwave’s picture

Turns out, there already is \Drupal\Core\Config\ConfigImporterFactory which does exactly this, so the recipe command probably just needs updating to use it?

longwave’s picture

Title: Add a ConfigImporterFactory » Use ConfigImporterFactory in RecipeCommand
Category: Feature request » Task
Status: Active » Needs review
dww’s picture

Component: configuration system » recipe system
Status: Needs review » Reviewed & tested by the community

Tee hee. Sounded familiar. 😅 Nice. Thanks for the pivot. MR looks good. Pipeline is green. Nothing to complain about.

Preference would be to change this only after #3453474: CLI entry point in Drupal Core lands so we don't have to rebase/resolve conflicts in that much larger MR. But it's pretty trivial, so it's probably fine either way.

RTBC'ing for now.

Thanks!
-Derek

dww’s picture

Issue summary: View changes
alexpott’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 3e7ef0a111b to main and 8cc6f0cc753 to 11.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • alexpott committed 8cc6f0cc on 11.x
    task: #3587725 Use ConfigImporterFactory in RecipeCommand
    
    By: dww
    By:...

  • alexpott committed 3e7ef0a1 on main
    task: #3587725 Use ConfigImporterFactory in RecipeCommand
    
    By: dww
    By:...
dww’s picture

Wow, that was fast! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.