FIX: nil and blank string should not override a site setting

This commit is contained in:
Sam 2016-04-04 16:36:32 +10:00
parent 0e02d24428
commit da419326be

View file

@ -121,7 +121,8 @@ module SiteSettingExtension
# exists it will be used instead of the setting and the setting will be hidden.
# Useful for things like API keys on multisite.
if opts[:shadowed_by_global] && GlobalSetting.respond_to?(name)
unless (val = GlobalSetting.send(name)) == ''.freeze
val = GlobalSetting.send(name)
unless val.nil? || (val == ''.freeze)
hidden_settings << name
shadowed_settings << name
current_value = val