FEATURE: detect theme errors and catch them (#7589)

* FEATURE: detect theme errors and catch them

* Bump COMPILER_VERSION

* Feedback

* Override eslint no console for one line

* Can't use our ajax method

* remove emoji from translation file
This commit is contained in:
Osama Sayegh
2019-05-24 17:25:55 +03:00
committed by GitHub
parent a51e2271af
commit e20c30987c
7 changed files with 97 additions and 6 deletions

View File

@@ -53,11 +53,19 @@ class Theme < ActiveRecord::Base
Theme.expire_site_cache! if saved_change_to_user_selectable? || saved_change_to_name?
notify_with_scheme = saved_change_to_color_scheme_id?
name_changed = saved_change_to_name?
reload
settings_field&.ensure_baked! # Other fields require setting to be **baked**
theme_fields.each(&:ensure_baked!)
if name_changed
theme_fields.select { |f| f.basic_html_field? }.each do |f|
f.value_baked = nil
f.ensure_baked!
end
end
remove_from_cache!
clear_cached_settings!
ColorScheme.hex_cache.clear