Problem/Motivation

First of all thanks to all you work on the UI Suite initiative!

We are adopting this theme on one of the projects and after the switch tests for components started to fail with:

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for ui_suite_bootstrap.settings with the following errors: ui_suite_bootstrap.settings:ui_styles_entity_status_unpublished missing schema, ui_suite_bootstrap.settings:ui_styles_regions missing schema

Steps to reproduce

  • have a component in a sub-theme
  • create a test based on sdc_devel SdcDevelComponentKernelTestBase
  • run the tests

Proposed resolution

Add schema

Remaining tasks

  • Merge request - done
  • Review
  • Merge
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

rosk0 created an issue. See original summary.

rosk0’s picture

Too bad that it doesn't pop up it the tests of the theme, but it is also confirmable with drush config:inspect --filter-keys=ui_suite_bootstrap.settings --strict-validation --detail.

We have been fixing similar issue in Bootstrap #3511614: Schema errors for bootstrap.settings when using the theme in the Drupal functional tests.

rosk0’s picture

Assigned: rosk0 » Unassigned

I've started fixing ui_suite_bootstrap.schema.yml by adding ui_styles_entity_status_unpublished. Test showed that this wasn't enough as I was missing a dependency on ui_styles_entity_status. I though "Oh ! user error! Will fix docs" , but when I wrote:

### Component validation in subthemes

When declaring your components in subtheme, the best way to test them is by using [SDC Devel].

In your test class, don't forget to specify all dependencies, otherwise you will have config schema validation errors:
```php
/**
* {@inheritdoc}
*/
protected static $themes = ['my_theme'];

/**
* {@inheritdoc}
*/
protected static $modules = [
'ui_patterns',
'ui_styles',
'ui_styles_entity_status',
'ui_styles_page',
];
```

[SDC Devel]:https://www.drupal.org/project/sdc_devel

at the bottom of the README.md I've realised that this is also wrong.

By adding ui_styles_entity_status_unpublished and ui_styles_regions to ui_suite_bootstrap.settings.yml in #3415078: Use UI Styles to remove templates we introduced two hidden implicit dependencies and in my opinion, should should be fixed by either:

  • removing those config sections and adding them during module installation ( or alternative dynamic approach ) - preferred
  • declaring dependencies explicitly

Would love to hear the feedback.

grimreaper’s picture

Hi,

Thanks for your appreciation on UI Suite :)

Thanks to have created this issue. I am aware of it and thinking about it as a background task.

Like you found out, the problem is that ui_styles_entity_status and ui_styles_page store config into the theme config and their hook_config_schema_alter is active of course only when the modules are enabled.

I need to check if a theme can implements hook module enabled. If yes, move the config from config/install to this hook.

Otherwise, maybe implements this hook into the ui_suite_bootstrap_companion submodule which is intended for stuff not possible to do/to override with a theme.

grimreaper’s picture

So I checked, themes cannot implements hook_modules_installed and hook_themes_installed.

So in ui_suite_bootstrap_companion, there could be both hooks:

  /**
   * Implements hook_modules_installed().
   */
  #[Hook('modules_installed')]
  public function modulesInstalled($modules, bool $is_syncing): void {
    if ($is_syncing) {
      return;
    }


  }

  /**
   * Implements hook_themes_installed().
   */
  #[Hook('themes_installed')]
  public function themesInstalled($theme_list): void {
    if (\Drupal::service('config.installer')->isSyncing()) {
      return;
    }

  }

hook_modules_installed:
- when enabling ui_styles_entity_status, loop on ui_suite_bootstrap and its children themes to add the config.
- when enabling ui_styles_page, loop on ui_suite_bootstrap and its children themes (or only on ui_suite_bootstrap) to add the config. if the theme as the sidebar_first and sidebar_second regions.

hook_themes_installed:
- if the installed theme is a subtheme of ui_suite_bootstrap and the ui_styles_entity_status or ui_styles_page are already enabled, add the config.

rosk0’s picture

Issue summary: View changes
Status: Active » Needs review
grimreaper’s picture

Assigned: Unassigned » grimreaper
Issue tags: +DevDaysAthens2026
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs review » Needs work

Hi,

Thanks for the MR, very nice start.

The other parts of comment 5 needs to be implemented as well.

herved’s picture

Hi, I noticed the same while running config_inspector on a project.

I think using theme_settings's third_party_settings in ui_styles_page and ui_styles_entity_status would have been ideal for this (no hook_config_schema_info_alter in those modules, no hook_modules_installed needed in UISB). But maybe that is too disruptive? OTOH I don't see other contribs using them:
- https://search.tresbien.tech/search?q=ui_styles_entity_status_unpublishe...
- https://search.tresbien.tech/search?q=ui_styles_regions&num=50&ctx=0

grimreaper’s picture

Hum, I don't know why I didn't save those settings in third_party_settings from the beginning.

If theme settings can have third party settings, this is definitely the way to go.

Then changes needs to be done in ui_styles_page and ui_styles_entity_status then we can update in the ui_suite_bootstrap theme.

Thanks @herved for pointing that!

grimreaper’s picture

PS: And I think I have the CSS variables from ui_skins in this case too...

grimreaper’s picture

Assigned: Unassigned » grimreaper

I have created the issues in UI Styles and UI Skins.