Skip to content

A platform for community discussion. Free, open, simple.

FIX: Fix narrative bot settings in multisites (#12380)

Bianca Nenciu50f8782def77
diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rb
index 5def8979919..2a6136176ab 100644
--- a/plugins/discourse-narrative-bot/plugin.rb
+++ b/plugins/discourse-narrative-bot/plugin.rb
@@ -48,12 +48,16 @@ after_initialize do
'../lib/discourse_narrative_bot/welcome_post_type_site_setting.rb'
].each { |path| load File.expand_path(path, __FILE__) }
- # Disable welcome message because that is what the bot is supposed to replace.
- SiteSetting.send_welcome_message = false if SiteSetting.send_welcome_message
-
- certificate_path = "#{Discourse.base_url}/discobot/certificate.svg"
- if SiteSetting.discourse_narrative_bot_enabled && !SiteSetting.allowed_iframes.include?(certificate_path)
- SiteSetting.allowed_iframes = SiteSetting.allowed_iframes.split('|').append("#{Discourse.base_url}/discobot/certificate.svg").join('|')
+ RailsMultisite::ConnectionManagement.each_connection do
+ if SiteSetting.discourse_narrative_bot_enabled
+ # Disable welcome message because that is what the bot is supposed to replace.
+ SiteSetting.send_welcome_message = false
+
+ certificate_path = "#{Discourse.base_url}/discobot/certificate.svg"
+ if !SiteSetting.allowed_iframes.include?(certificate_path)
+ SiteSetting.allowed_iframes = SiteSetting.allowed_iframes.split('|').append(certificate_path).join('|')
+ end
+ end
end
require_dependency 'plugin_store'