FIX: discourse_merger halts when topic has nil category

This commit is contained in:
Neil Lalonde 2018-06-29 12:21:25 -04:00
parent 1772b56cda
commit c33ee13c4c
1 changed files with 6 additions and 1 deletions

View File

@ -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]