FIX: discourse_merger halts when topic has nil category
This commit is contained in:
parent
1772b56cda
commit
c33ee13c4c
|
@ -218,7 +218,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def copy_topics
|
def copy_topics
|
||||||
copy_model(Topic, skip_processing: true, mapping: @topics)
|
copy_model(Topic, mapping: @topics)
|
||||||
[TopicAllowedGroup, TopicAllowedUser, TopicEmbed, TopicSearchData,
|
[TopicAllowedGroup, TopicAllowedUser, TopicEmbed, TopicSearchData,
|
||||||
TopicTimer, TopicUser, TopicViewItem
|
TopicTimer, TopicUser, TopicViewItem
|
||||||
].each do |k|
|
].each do |k|
|
||||||
|
@ -434,6 +434,11 @@ class BulkImport::DiscourseMerger < BulkImport::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def process_topic(topic)
|
||||||
|
return nil if topic['category_id'].nil?
|
||||||
|
topic
|
||||||
|
end
|
||||||
|
|
||||||
def process_post(post)
|
def process_post(post)
|
||||||
post[:last_editor_id] = user_id_from_imported_id(post[:user_id])
|
post[:last_editor_id] = user_id_from_imported_id(post[:user_id])
|
||||||
@topic_id_by_post_id[post[:id]] = post[:topic_id]
|
@topic_id_by_post_id[post[:id]] = post[:topic_id]
|
||||||
|
|
Loading…
Reference in New Issue