From c33ee13c4cbcd5e6e182e18e93b2eabe31a421bc Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 29 Jun 2018 12:21:25 -0400 Subject: [PATCH] FIX: discourse_merger halts when topic has nil category --- script/bulk_import/discourse_merger.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/bulk_import/discourse_merger.rb b/script/bulk_import/discourse_merger.rb index a0801d12410..9de5cd879aa 100644 --- a/script/bulk_import/discourse_merger.rb +++ b/script/bulk_import/discourse_merger.rb @@ -218,7 +218,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base end def copy_topics - copy_model(Topic, skip_processing: true, mapping: @topics) + copy_model(Topic, mapping: @topics) [TopicAllowedGroup, TopicAllowedUser, TopicEmbed, TopicSearchData, TopicTimer, TopicUser, TopicViewItem ].each do |k| @@ -434,6 +434,11 @@ class BulkImport::DiscourseMerger < BulkImport::Base end end + def process_topic(topic) + return nil if topic['category_id'].nil? + topic + end + def process_post(post) post[:last_editor_id] = user_id_from_imported_id(post[:user_id]) @topic_id_by_post_id[post[:id]] = post[:topic_id]