mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 18:57:20 -05:00
When installing a new theme, custom color palettes (with theme_id = nil) were being incorrectly deleted. This occurred because the theme installation process called `update_theme_color_schemes` before the new theme was persisted to the database. Since the theme's ID was nil, the query `ColorScheme.unscoped.where(theme_id: nil)` would match ALL custom color schemes, causing them to be deleted during the cleanup phase. Bug introduced in this PR - https://github.com/discourse/discourse/pull/34722