From 144584aacbe007ec445c49d57db05edae7947f3c Mon Sep 17 00:00:00 2001 From: Michael Maroszek Date: Fri, 12 Feb 2021 14:29:05 +0100 Subject: [PATCH] fix vbulletin importer to hide soft-deleted posts (#12057) equal to theads posts can be soft-deleted which results in a visibile = 2 state. at the moment those posts will be imported fully visible. --- script/bulk_import/vbulletin.rb | 2 +- script/import_scripts/vbulletin.rb | 2 +- script/import_scripts/vbulletin5.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/bulk_import/vbulletin.rb b/script/bulk_import/vbulletin.rb index b437137c384..c251ef07ab5 100644 --- a/script/bulk_import/vbulletin.rb +++ b/script/bulk_import/vbulletin.rb @@ -359,7 +359,7 @@ class BulkImport::VBulletin < BulkImport::Base reply_to_post_number: reply_to_post_number, user_id: user_id_from_imported_id(row[3]), created_at: Time.zone.at(row[4]), - hidden: row[5] == 0, + hidden: row[5] != 1, raw: normalize_text(row[6]), } diff --git a/script/import_scripts/vbulletin.rb b/script/import_scripts/vbulletin.rb index d3fdc7c464d..e1c86bf83fe 100644 --- a/script/import_scripts/vbulletin.rb +++ b/script/import_scripts/vbulletin.rb @@ -398,7 +398,7 @@ EOM topic_id: topic[:topic_id], raw: raw, created_at: parse_timestamp(post["dateline"]), - hidden: post["visible"].to_i == 0, + hidden: post["visible"].to_i != 1, } if parent = topic_lookup_from_imported_post_id(post["parentid"]) p[:reply_to_post_number] = parent[:post_number] diff --git a/script/import_scripts/vbulletin5.rb b/script/import_scripts/vbulletin5.rb index 682cbcdc50b..bdf80dcd3b1 100644 --- a/script/import_scripts/vbulletin5.rb +++ b/script/import_scripts/vbulletin5.rb @@ -327,7 +327,7 @@ class ImportScripts::VBulletin < ImportScripts::Base topic_id: topic[:topic_id], raw: raw, created_at: parse_timestamp(post["dateline"]), - hidden: post["visible"].to_i == 0, + hidden: post["visible"].to_i != 1, } if parent = topic_lookup_from_imported_post_id(post["parentid"]) p[:reply_to_post_number] = parent[:post_number]