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
- Install Drupal 11, with the
bootstrap_layoutsmodule version 8.x-5.x-dev and Layout Builder enabled. - Enable Layout Builder for an entity view display.
- Add a section using one of the Bootstrap Layouts layouts, for example the two-column layout.
- Save the display configuration.
- Observe missing schema warnings for the saved display configuration under
layout_settings.layoutandlayout_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:
wrapperas a string.classesas a sequence of strings.attributesas a string.add_layout_classas a boolean for layout wrapper settings.add_region_classesas 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_1colbs_1col_stackedbs_2colbs_2col_brickedbs_2col_stackedbs_3colbs_3col_brickedbs_3col_stackedbs_4colbs_4col_brickedbs_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
Issue fork bootstrap_layouts-3602713
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
Comment #3
lolgm commentedMR !13 implements the proposed solution in this issue.