Recipes' ConfigConfigurator should not immediately check for conflicts with active config

Created on 9 May 2024, 7 months ago
Updated 17 July 2024, 4 months ago

Problem/Motivation

If a recipe's config has conflicts with active config, it throws a RecipePreExistingConfigException. This happens in \Drupal\Core\Recipe\ConfigConfigurator::__construct(), which is called the moment a recipe is even loaded from disk -- not even when it's applied.

If you need to inspect a recipe, without actually trying to apply it (in Project Browser, for example), this is way too aggressive and can lead to exceptions that seem to come out of nowhere.

Proposed resolution

We should have an explicit method on ConfigConfigurator which checks for conflicts with active config (it should just move the code that's already in __construct(); we don't need to implement any new logic). And we should call that method in two places:

  • In \Drupal\Core\Recipe\RecipeCommand::execute(), just before we create the backup checkpoint.
  • At the very top of \Drupal\Core\Recipe\RecipeRunner::processRecipe().
πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
recipe systemΒ  β†’

Last updated about 17 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024