Problem/Motivation

Mads Bordinggaard brought up in the #plus-suite slack channel that they were unable to apply the reciple to their existing site or even a newly installed d11 site.

Steps to reproduce

Since we resolved https://www.drupal.org/project/plus_suite/issues/3517909 I was curious about why this might be happening and gave it a shot on my local machine by following the DDEV Quickstart instructions for drupal 11 and then following the Plus Suite description on how to apply to an existing site and sure enough I got 2 errors:

[error]  The field_image entity reference field (entity_type: block_content, bundle: image) no longer has any valid bundle it can reference. The field is not working correctly anymore and has to be adjusted.

In FieldConfig.php line 323:
Attempted to create, modify or delete an instance of field with name layout_builder__layout on entity type node when the field storage does not exist.

After futzing I found that it was because no node types yet had Layout Builder turned on in their display settings. I could easily get around the issue by doing that manually before installing the recipe but that defeats the purpose of recipes so I rebuild and reviewed the code.

It turns out in the Make the recipe work ticket we also moved the field.storage.node.layout_builder__layout.yml to config/optional instead of just in the standard config folder. By moving that config file back out of optional the recipe installs without any issues.

I am unsure why the optional config isn't being run because my understanding is those are run unless there is a conflict, but clearly I am either misunderstanding or there is some nuance to that system that is breaking this use case.

I did manually turn on layout builder for the Basic Page that comes with core's default install just to ensure we didn't hit a conflict if the field storage already existed and it worked just fine.

Proposed resolution

Move the config file back out of optional.

Issue fork plus_suite-3522982

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

drakythe created an issue. See original summary.

  • tim bozeman committed 0368e4f4 on 1.0.x
    Issue #3522982 by drakythe, tim bozeman: Optional config breaks install...
tim bozeman’s picture

Status: Active » Fixed

Hmm... Yeah, thank you. I will reopen this issue then 😅 #3517909: Make the recipe work for existing sites

drakythe’s picture

The recipe should still be applicable even with the file not in optional. The actual fix for making the recipe work with other recipes was flipping the strict setting to false.

Status: Fixed » Closed (fixed)

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