diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml index 88f34652b98607d7501214c6a510015c212ecf33..673ed7b57265755311205984f7369d799e498658 100644 --- a/core/modules/system/config/schema/system.schema.yml +++ b/core/modules/system/config/schema/system.schema.yml @@ -508,7 +508,13 @@ system.feature_flags: condition.plugin.current_theme: type: condition.plugin + constraints: + FullyValidatable: ~ mapping: theme: type: string label: Theme + constraints: + NotBlank: [] + ExtensionName: [] + ExtensionExists: theme diff --git a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php index 3ed8129a6f0d83a0588798e45bede9179fa44bf2..2ae71de8c1c14aeb7877bc400b54eadfc3ae1d51 100644 --- a/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php +++ b/core/modules/system/src/Plugin/Condition/CurrentThemeCondition.php @@ -128,4 +128,14 @@ public function getCacheContexts() { return $contexts; } + /** + * {@inheritdoc} + */ + public function calculateDependencies() { + if (!$this->configuration['theme']) { + return []; + } + return ['theme' => [$this->configuration['theme']]]; + } + } diff --git a/core/modules/system/tests/modules/condition_test/config/install/condition_test.settings.yml b/core/modules/system/tests/modules/condition_test/config/install/condition_test.settings.yml index cb9312961822b10350845fcdbaa0147a7494f547..658217298485e3f70715b649ea690a4ee1368c2a 100644 --- a/core/modules/system/tests/modules/condition_test/config/install/condition_test.settings.yml +++ b/core/modules/system/tests/modules/condition_test/config/install/condition_test.settings.yml @@ -3,7 +3,7 @@ visibility: current_theme: id: current_theme - theme: stable + theme: stark negate: false context_mapping: { } request_path: