mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
FIX: Make sure to observe shadowed settings when refreshing
This commit is contained in:
parent
5d6f6c4887
commit
0da022a1ba
1 changed files with 13 additions and 11 deletions
|
@ -196,18 +196,20 @@ module SiteSettingExtension
|
||||||
# add defaults, cause they are cached
|
# add defaults, cause they are cached
|
||||||
new_hash = defaults.merge(new_hash)
|
new_hash = defaults.merge(new_hash)
|
||||||
|
|
||||||
changes,deletions = diff_hash(new_hash, old)
|
# add shadowed
|
||||||
|
shadowed_settings.each do |ss|
|
||||||
|
new_hash[ss] = GlobalSetting.send(ss)
|
||||||
|
end
|
||||||
|
|
||||||
|
changes, deletions = diff_hash(new_hash, old)
|
||||||
|
|
||||||
if deletions.length > 0 || changes.length > 0
|
|
||||||
changes.each do |name, val|
|
changes.each do |name, val|
|
||||||
next if shadowed_settings.include?(name)
|
|
||||||
current[name] = val
|
current[name] = val
|
||||||
end
|
end
|
||||||
deletions.each do |name,val|
|
deletions.each do |name, val|
|
||||||
next if shadowed_settings.include?(name)
|
|
||||||
current[name] = defaults[name]
|
current[name] = defaults[name]
|
||||||
end
|
end
|
||||||
end
|
|
||||||
clear_cache!
|
clear_cache!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue