From fba1a483c1429988a5ffb5a4bbc97d4954249980 Mon Sep 17 00:00:00 2001 From: Ruben Oussoren Date: Mon, 13 Jan 2025 17:35:22 -0500 Subject: [PATCH] FIX: Avoid loading reactions index when plugin is not installed (#30749) Adding fix to avoid loading reactions indexes when plugin is not installed --- script/bulk_import/base.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/script/bulk_import/base.rb b/script/bulk_import/base.rb index 32faf7c8f59..097f56ef6e9 100644 --- a/script/bulk_import/base.rb +++ b/script/bulk_import/base.rb @@ -311,9 +311,15 @@ class BulkImport::Base @chat_message_mapping = load_index(MAPPING_TYPES[:chat_message]) @last_chat_message_id = last_id(Chat::Message) - puts "Loading reaction indexes..." - @discourse_reaction_mapping = load_index(MAPPING_TYPES[:discourse_reactions_reaction]) - @last_discourse_reaction_id = last_id(DiscourseReactions::Reaction) + if defined?(::DiscourseReactions) + puts "Loading reaction indexes..." + @discourse_reaction_mapping = load_index(MAPPING_TYPES[:discourse_reactions_reaction]) + @last_discourse_reaction_id = last_id(DiscourseReactions::Reaction) + else + puts "Skipping reaction indexes - plugin not installed" + @discourse_reaction_mapping = {} + @last_discourse_reaction_id = 0 + end end def use_bbcode_to_md?