DEV: Fix syntax/formatting in xenforo import script (#19761)

Followup to 7dfe85fc
This commit is contained in:
David Taylor 2023-01-05 12:47:05 +00:00 committed by GitHub
parent 41acabad19
commit d5491b13f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 12 deletions

View File

@ -89,6 +89,7 @@ class ImportScripts::XenForo < ImportScripts::Base
post_create_action: proc do |u| post_create_action: proc do |u|
import_avatar(user['id'], u) import_avatar(user['id'], u)
end end
}
end end
end end
end end
@ -316,7 +317,7 @@ class ImportScripts::XenForo < ImportScripts::Base
id: message_id, id: message_id,
user_id: user_id, user_id: user_id,
raw: raw, raw: raw,
created_at: Time.zone.at(post["message_date"].to_i), created_at: Time.zone.at(post["message_date"].to_i),
import_mode: true import_mode: true
} }
unless post["topic_id"] > 0 unless post["topic_id"] > 0
@ -454,7 +455,7 @@ class ImportScripts::XenForo < ImportScripts::Base
# not all attachments have an [ATTACH=] tag so we need to get the other ID's from the xf_attachment table # not all attachments have an [ATTACH=] tag so we need to get the other ID's from the xf_attachment table
if xf_type == :attachment && import_id > 0 if xf_type == :attachment && import_id > 0
sql = "SELECT attachment_id FROM #{TABLE_PREFIX}attachment WHERE content_id=#{import_id} and content_type='post';" sql = "SELECT attachment_id FROM #{TABLE_PREFIX}attachment WHERE content_id=#{import_id} and content_type='post';"
ids.merge(mysql_query(sql).to_a.map { |v| v["attachment_id"].to_i}) ids.merge(mysql_query(sql).to_a.map { |v| v["attachment_id"].to_i })
end end
ids.each do |id| ids.each do |id|