Layout removed on save

Created on 26 August 2025, about 2 months ago

Problem/Motivation

After building a layout for a content type I added a views list block with a view in view field. When I attempted to reopen the layout it was empty.

Steps to reproduce

The view that caused the failure had inconsistent contextual filters. When adding it, there was no ID field in the config menu. There were errors in the log about this time referred by the view edit process
:
TypeError: Cannot access offset of type array in isset or empty in Drupal\views\Plugin\views\argument_validator\Entity->validateArgument() (line 196 of /home3/sustainw/public_html/migrate/dr_config/web/core/modules/views/src/Plugin/views/argument_validator/Entity.php)

Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Failed to start the session because headers have already been sent by "/home3/sustainw/public_html/migrate/dr_config/vendor/symfony/http-foundation/Response.php" at line 382.") in "@help_topics/block.place.html.twig" at line 10. in Twig\Template->yield() (line 10 of /home3/sustainw/public_html/migrate/dr_config/web/core/modules/block/help_topics/block.place.html.twig).

Proposed resolution

I rebuilt the layout and sorted out the problem view. I was then able to save the layout without problems. I was wondering if there might be a way of adding guard rails to layout blocks so that one misbehaving addition would not remove the entire layout.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ’¬ Support request
Status

Active

Version

11.2 πŸ”₯

Component

layout_builder.module

Created by

πŸ‡ΊπŸ‡ΈUnited States jcory

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

Comments & Activities

  • Issue created by @jcory
  • This issue is filed as a support request. Are you looking for support or for some changes to Drupal?

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

    Thanks for responding. I was wondering if an enhancement could be made to the core module so that in the future if someone else adds a malformed view it would not result in the layout being deleted. I was thinking something like a programmatic containment vessel for each block in which validation occurs and marks the block as valid or invalid. If invalid, the block could be "quarantined" from the rest of the layout. The developer could then delete the block or replace it.

Production build 0.71.5 2024