FIX: Show warning only if new value is different (#12893)

FIX: Show warning only if new value is different (#12893)

A warning is logged when a shadowed site setting is being changed. This should not be the case when the new value is the same as the old one.

diff --git a/lib/site_setting_extension.rb b/lib/site_setting_extension.rb
index 3196e2a..28c7a9c 100644
--- a/lib/site_setting_extension.rb
+++ b/lib/site_setting_extension.rb
@@ -484,7 +484,7 @@ module SiteSettingExtension
     end
 
     define_singleton_method "#{clean_name}=" do |val|
-      Rails.logger.warn("An attempt was to change #{clean_name} SiteSetting to #{val} however it is shadowed so this will be ignored!")
+      Rails.logger.warn("An attempt was to change #{clean_name} SiteSetting to #{val} however it is shadowed so this will be ignored!") if value != val
       nil
     end
 

GitHub sha: 3ff9dbb1

This commit appears in #12893 which was approved by ZogStriP. It was merged by jjaffeux.