Add better messaging in the error reporting when a recipe fails to apply becuase a field already exists and is being treated strictly

Created on 29 May 2025, 8 days ago

Problem/Motivation

This is the error message a user got when applying a recipe that treats the field storage config strictly for field_date when there is already a field_date in the CMS.

TypeError: Drupal\Core\Recipe\ConfigConfigurator::recursiveSortByKey(): Argument #1 ($data) must be of type array, false given, called in /var/www/html/public_html/core/lib/Drupal/Core/Recipe/ConfigConfigurator.php on line 60 in Drupal\Core\Recipe\ConfigConfigurator::recursiveSortByKey() (line 77 of /var/www/html/public_html/core/lib/Drupal/Core/Recipe/ConfigConfigurator.php).

It would be better if we could identity that failure and display the errant field to the user. Something like:

This recipe can't be applied because there is already a field_name in your system

Steps to reproduce

1. Create a field named field_date manually.
2. Apply the drupal_cms_events recipe.
3. See the fatal error.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

recipe system

Created by

πŸ‡ΊπŸ‡ΈUnited States thejimbirch Cape Cod, Massachusetts

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

Comments & Activities

Production build 0.71.5 2024