Merge pull request #3868 from gschlager/patch-3

Fix base and vBulletin importer
This commit is contained in:
Robin Ward 2015-10-23 01:21:36 +11:00
commit 3c99d536f6
2 changed files with 3 additions and 3 deletions

View File

@ -199,7 +199,7 @@ class ImportScripts::Base
Post.exec_sql('create temp table import_ids(val varchar(200) primary key)')
import_id_clause = import_ids.map{|id| "('#{PG::Connection.escape_string(id)}')"}.join(",")
import_id_clause = import_ids.map{|id| "('#{PG::Connection.escape_string(id.to_s)}')"}.join(",")
Post.exec_sql("insert into import_ids values #{import_id_clause}")
existing = "#{type.to_s.classify}CustomField".constantize.where(name: 'import_id')

View File

@ -210,7 +210,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
SQL
break if topics.size < 1
next if all_records_exist? :posts, topics.map {|t| "thread-#{topic["threadid"]}" }
next if all_records_exist? :posts, topics.map {|t| "thread-#{t["threadid"]}" }
create_posts(topics, total: topic_count, offset: offset) do |topic|
raw = preprocess_post_raw(topic["raw"]) rescue nil
@ -555,7 +555,7 @@ class ImportScripts::VBulletin < ImportScripts::Base
end
def mysql_query(sql)
@client.query(sql, cache_rows: false)
@client.query(sql, cache_rows: true)
end
end