mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: discourse_merger halts when topic has nil category
This commit is contained in:
@ -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]
|
||||
|
Reference in New Issue
Block a user