From 6238a43f9302097b3522f8e7c11b4f2a135fa093 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Wed, 21 Oct 2015 19:07:31 +0200 Subject: [PATCH] Fix base and vBulletin importer --- script/import_scripts/base.rb | 2 +- script/import_scripts/vbulletin.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 49b86cacc..18da1fd7a 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -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') diff --git a/script/import_scripts/vbulletin.rb b/script/import_scripts/vbulletin.rb index 22e5883db..588e1ddff 100644 --- a/script/import_scripts/vbulletin.rb +++ b/script/import_scripts/vbulletin.rb @@ -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