Problem/Motivation
Rivet ships config/install/rivet.settings.yml and adds several custom values through its theme settings form, but it does not provide a corresponding config/schema/rivet.schema.yml file.
Consequently, Drupal's typed configuration manager does not recognize rivet.settings as having configuration schema. Configuration inspection and schema-validation workflows report the object as having no schema.
Rivet currently stores the following custom settings:
site_namesubtitlehide_home_breadcrumbfooter_variantprivacy_urlsidebar_border_rightpage_widthcontent_width
Core's standard theme_settings schema type covers common settings such as the logo, favicon, and optional features, but it does not describe these Rivet-specific keys.
Inherited Rivet subthemes have separately named configuration objects such as my_subtheme.settings. Those subthemes also need a schema declaration that extends Rivet's settings schema. Generated Rivet starterkit themes should receive an appropriately renamed schema file.
Steps to reproduce
- Install Rivet on a supported Drupal version.
- Run:
drush php:eval '$typed = \Drupal::service("config.typed"); var_export($typed->hasConfigSchema("rivet.settings"));' - Observe that the command returns
false. - Alternatively, with Config Inspector enabled, run:
drush config:inspect --only-error --filter-keys='rivet.settings' - Observe that
rivet.settingsis reported as having no schema.
This was reproduced with Rivet 1.2.x development code on Drupal 11.4.12.
Proposed resolution
- Add
config/schema/rivet.schema.yml. - Define
rivet.settingsas extending core'stheme_settingstype. - Provide mappings for every Rivet-specific setting, using appropriate string and boolean types.
- Add choice constraints for settings with fixed options where practical.
- Ensure Rivet starterkit generation copies and renames the schema for the generated theme.
- Document that an inherited subtheme should declare its settings schema using Rivet's definition, for example:
my_subtheme.settings: type: rivet.settings label: 'My subtheme settings' - Add automated coverage confirming that Rivet's default and form-submitted settings comply with the schema on supported Drupal versions.
Remaining tasks
- [ ] Add the Rivet configuration schema.
- [ ] Add schema-validation test coverage.
- [ ] Verify the generated starterkit theme has correctly renamed schema.
- [ ] Verify and document schema inheritance for Rivet subthemes.
- [ ] Review and merge.
User interface changes
None.
API changes
Adds typed configuration metadata for Rivet theme settings. No PHP API changes.
Data model changes
None. Existing configuration values are unchanged; this adds schema metadata describing them.
Issue fork rivet-3636686
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 #4
jwilson3Comment #6
jwilson3Released in 1.2.1