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_name
  • subtitle
  • hide_home_breadcrumb
  • footer_variant
  • privacy_url
  • sidebar_border_right
  • page_width
  • content_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

  1. Install Rivet on a supported Drupal version.
  2. Run: drush php:eval '$typed = \Drupal::service("config.typed"); var_export($typed->hasConfigSchema("rivet.settings"));'
  3. Observe that the command returns false.
  4. Alternatively, with Config Inspector enabled, run:
    drush config:inspect --only-error --filter-keys='rivet.settings'
  5. Observe that rivet.settings is 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.settings as extending core's theme_settings type.
  • 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

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

jwilson3 created an issue. See original summary.

  • jwilson3 committed 746163fb on 1.2.x
    Issue #3636686 by jwilson3: Add Rivet theme settings schema
    
jwilson3’s picture

Assigned: jwilson3 » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

jwilson3’s picture

Released in 1.2.1

  • jwilson3 committed dd67f7aa on 1.2.x
    Issue #3636686 by jwilson3: Update Rivet default settings YAML format