Fixes some minor issues with the phpBB3 importer
FEATURE: Adds a link to the Howto on meta FIX: Suppresses multiple warnings about invalid votes for the same topic FIX: Adds missing table prefixes FIX: Removes duplicate column from query
This commit is contained in:
parent
e344859fbf
commit
cbb0fc350d
|
@ -1,6 +1,10 @@
|
|||
# Importer for phpBB 3.0 and 3.1
|
||||
# Documentation: https://meta.discourse.org/t/importing-from-phpbb3/30810
|
||||
|
||||
if ARGV.length != 1 || !File.exists?(ARGV[0])
|
||||
STDERR.puts '', 'Usage of phpBB3 importer:', 'bundle exec ruby phpbb3.rb <path/to/settings.yml>'
|
||||
STDERR.puts '', "Use the settings file from #{File.expand_path('phpbb3/settings.yml', File.dirname(__FILE__))} as an example."
|
||||
STDERR.puts '', 'Still having problems? Take a look at https://meta.discourse.org/t/importing-from-phpbb3/30810'
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
|
|
@ -52,11 +52,11 @@ module ImportScripts::PhpBB3
|
|||
|
||||
def fetch_categories
|
||||
query(<<-SQL)
|
||||
SELECT f.forum_id, f.parent_id, f.forum_name, f.forum_name, f.forum_desc, x.first_post_time
|
||||
FROM phpbb_forums f
|
||||
SELECT f.forum_id, f.parent_id, f.forum_name, f.forum_desc, x.first_post_time
|
||||
FROM #{@table_prefix}_forums f
|
||||
LEFT OUTER JOIN (
|
||||
SELECT MIN(topic_time) AS first_post_time, forum_id
|
||||
FROM phpbb_topics
|
||||
FROM #{@table_prefix}_topics
|
||||
GROUP BY forum_id
|
||||
) x ON (f.forum_id = x.forum_id)
|
||||
WHERE f.forum_type != #{Constants::FORUM_TYPE_LINK}
|
||||
|
|
|
@ -122,7 +122,8 @@ module ImportScripts::PhpBB3
|
|||
end
|
||||
|
||||
votes << option_id
|
||||
else !warned
|
||||
elsif !warned
|
||||
warned = true
|
||||
Rails.logger.warn("Topic with id #{topic_id} has invalid votes.")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue