Trying to save default layout disables Layout Library

Created on 20 July 2022, over 2 years ago
Updated 9 April 2024, 9 months ago

Problem/Motivation

This is most likely related to: #3028973: Layout Library tries to delete layout_selection field without checking if it's being used by other entity view displays β†’ that was closed a couple of years ago.

Tried setting up for a new bundle this week:
- already have content using LB for layout of Full Content view mode
- set layout for full content to allow per node and use stored layouts (LL)
- this gives me the layout_selection field for my bundle
- added a few layouts to library for this existing bundle

- placed that field in my form display
- created multiple nodes setting the layout selection

Everything works as expected.

Thinking that selecting None as LL selection means it will use the "Default" layout (that i had previously set up for ALL nodes of this type) i go to edit that layout to make an adjustment. When i save those changes the following exception is created:

Drupal\Core\Field\FieldException: Attempt to create a field layout_selection that does not exist on entity type node. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 315 of /var/www/html/core/modules/field/src/Entity/FieldConfig.php).

as well as unsets both the allow per node and use stored layouts options for my view mode.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada liquidcms

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    7 pass
  • Updated the logic so that it doesn't apply side-effects during a site/profile install.

  • πŸ‡ΊπŸ‡ΈUnited States kwiseman

    I was unable to recreate this issue using Drupal core 10.2.5 with PHP 8.2 and Layout Builder Library 8.x-1.0-beta4. My testing site wasn't customized beyond the standard profile very much (I added the Admin Toolbar module and created a new content type to follow along with the suggested steps).

    This last step was a bit unclear to me, but I tried all actions I thought it was referring to:

    Thinking that selecting None as LL selection means it will use the "Default" layout (that i had previously set up for ALL nodes of this type) i go to edit that layout to make an adjustment. When i save those changes the following exception is created

    Specifically, I tried:

    • Changing and saving the full content view mode's layout.
    • Changing and saving the default view mode's layout (which wasn't using Layout Builder).
    • Changing and saving the layout of an individual node with the layout_selection field set to None.
Production build 0.71.5 2024