A platform for community discussion. Free, open, simple.
FIX: enforce system themes to be enabled (#33643)
Krzysztof Kotlarek2ee1c6d7d463
diff --git a/lib/system_themes_manager.rb b/lib/system_themes_manager.rbindex eceb24a6d2d..1a09cf823ba 100644--- a/lib/system_themes_manager.rb+++ b/lib/system_themes_manager.rb@@ -26,6 +26,7 @@ class SystemThemesManager.first&.update!(user_selectable: true)end+ remote_theme.update_column(:enabled, true)Stylesheet::Manager.clear_theme_cache!endenddiff --git a/spec/lib/system_themes_manager_spec.rb b/spec/lib/system_themes_manager_spec.rbindex b88835434cb..3d9cbc8fa9e 100644--- a/spec/lib/system_themes_manager_spec.rb+++ b/spec/lib/system_themes_manager_spec.rb@@ -12,4 +12,11 @@ RSpec.describe SystemThemesManager doexpect(Theme.horizon_theme.color_schemes.where(user_selectable: true).count).to eq(2)expect(Theme.horizon_theme.color_schemes.where(user_selectable: false).count).to eq(10)end++ it "renables themes" do+ SystemThemesManager.sync!+ Theme.horizon_theme.update_column(:enabled, false)+ SystemThemesManager.sync!+ expect(Theme.horizon_theme.reload.enabled).to be true+ endend