Recipe disambiguation of recipes from other locations

Created on 29 April 2024, 7 months ago
Updated 15 May 2024, 6 months ago

Problem/Motivation

There's a bug in \Drupal\Core\Recipe\RecipeRunner::toBatchOperationsRecipe(), and it's this:

    if (in_array($recipe->name, $recipes, TRUE)) {
      return [];
    }

If two different recipes have the same human-readable name, the second one will be skipped! This can lead to inexplicable-seeming buggy behavior, especially if you have the second recipe depending on the first one.

Proposed resolution

Recipe discovery should be based on the current recipe's path. If you want to depend on a core recipe the recipe dependency should be listed with the core path. For example, to add a dependency on the editorial_workflow recipe from core a custom or contrib recipe would need to do:

name: 'Workflow extra'
recipes:
  - core/recipes/editorial_workflow
config:
// more recipe config

By using the recipe name core/recipes/editorial_workflow you are indicating that you need to get the recipe from core. If it was editorial_workflow then we would look in a parent directory of the current recipe for such a recipe.

Remaining tasks

Fix the bug.

πŸ› Bug report
Status

Fixed

Version

11.0

Component

Code

Created by

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

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024