From 5ddb82c9b687891280b26e9113ffbaaac36d4cc4 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 1 Nov 2014 18:25:03 +1100 Subject: [PATCH] impor script fixes --- script/import_scripts/bespoke_1.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb index beed653802d..e91a001a578 100644 --- a/script/import_scripts/bespoke_1.rb +++ b/script/import_scripts/bespoke_1.rb @@ -28,8 +28,8 @@ class ImportScripts::Bespoke < ImportScripts::Base end def execute - import_users - import_categories + #import_users + #import_categories import_posts end @@ -202,18 +202,20 @@ class ImportScripts::Bespoke < ImportScripts::Base topic[:post_id] = post[:id] else parent = topic_lookup_from_imported_post_id(topic[:post_id]) + next unless parent + mapped[:topic_id] = parent[:topic_id] reply_to_post_id = post_id_from_imported_post_id(post[:reply_id]) if reply_to_post_id reply_to_post_number = @post_number_map[reply_to_post_id] - if reply_to_post_number + if reply_to_post_number && reply_to_post_number > 1 mapped[:reply_to_post_number] = reply_to_post_number end end end - return nil if topic[:deleted] or post[:deleted] + next if topic[:deleted] or post[:deleted] mapped end