Problem/Motivation

The Bootstrap Layouts module stores layout plugin configuration for its provided layouts. In addition to the base layout plugin settings handled by Drupal core, the module stores its own layout and regions settings.

In the current 8.x-5.x-dev, the module does not provide a config/schema/bootstrap_layouts.schema.yml file. Because of that, Drupal falls back to the generic core layout_plugin.settings schema, which does not describe the Bootstrap Layouts-specific layout and regions keys or their nested values.

This causes missing schema warnings.

The warnings affect layout settings saved by the Bootstrap Layouts plugins, such as wrapper elements, CSS classes, HTML attributes, and the boolean options for adding layout or region classes. These settings are valid configuration written by the module, but they are currently not described by typed configuration schema.

This should be fixed so that all configuration written by Bootstrap Layouts layout plugins has a proper schema, schema validation warnings are removed, and downstream projects can rely on accurate typed configuration metadata.

Steps to reproduce

  1. Install Drupal 11, with the bootstrap_layouts module version 8.x-5.x-dev and Layout Builder enabled.
  2. Enable Layout Builder for an entity view display.
  3. Add a section using one of the Bootstrap Layouts layouts, for example the two-column layout.
  4. Save the display configuration.
  5. Observe missing schema warnings for the saved display configuration under layout_settings.layout and layout_settings.regions.

Proposed resolution

Add a new config/schema/bootstrap_layouts.schema.yml file for the module.

The patch adds two reusable schema types:

  • bootstrap_layouts.wrapper_settings, used for the top-level layout wrapper settings.
  • bootstrap_layouts.region_settings, used for each individual region's settings.

These types describe the configuration currently saved by the module:

  • wrapper as a string.
  • classes as a sequence of strings.
  • attributes as a string.
  • add_layout_class as a boolean for layout wrapper settings.
  • add_region_classes as a boolean for region settings.

The patch also adds one layout_plugin.settings.<plugin_id> schema entry for each layout plugin provided by the module:

  • bs_1col
  • bs_1col_stacked
  • bs_2col
  • bs_2col_bricked
  • bs_2col_stacked
  • bs_3col
  • bs_3col_bricked
  • bs_3col_stacked
  • bs_4col
  • bs_4col_bricked
  • bs_4col_stacked

Each plugin-specific schema entry extends layout_plugin.settings and adds mappings for the Bootstrap Layouts-specific layout and regions configuration. The region mappings match the actual region names declared by each layout plugin.

This resolves the schema warnings caused by Bootstrap Layouts because Drupal can now validate the module-specific layout and region settings instead of treating them as undefined configuration.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ➖ Testing to ensure no regression
  • ➖ Automated unit testing coverage
  • ➖ Automated functional testing coverage
  • ➖ UX/UI designer responsibilities
  • ➖ Readability
  • ➖ Accessibility
  • ➖ Performance
  • ➖ Security
  • ➖ Documentation
  • ➖ Code review by maintainers
  • ➖ Full testing and approval
  • ➖ Credit contributors
  • ➖ Review with the product owner
  • ➖ Release notes snippet
  • ❌ Release

API changes

  • N/A

Data model changes

  • N/A

Release notes snippet

  • N/A
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

lolgm created an issue. See original summary.

lolgm’s picture

Issue summary: View changes
Status: Active » Needs review

MR !13 implements the proposed solution in this issue.