mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Improvements to phpBB3 import script (#10999)
* FEATURE: Import attachments * FEATURE: Add support for importing multiple forums in one * FEATURE: Add support for category and tag mapping * FEATURE: Import groups * FIX: Add spaces around images * FEATURE: Custom mapping of user rank to trust levels * FIX: Do not fail import if it cannot import polls * FIX: Optimize existing records lookup Co-authored-by: Gerhard Schlager <mail@gerhard-schlager.at> Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
parent
82af278ae5
commit
a71b219c9a
20 changed files with 1606 additions and 79 deletions
|
@ -57,6 +57,11 @@ module ImportScripts
|
|||
UserCustomField.where(name: 'import_id', value: import_id.to_s).first.try(:user)
|
||||
end
|
||||
|
||||
def find_username_by_import_id(import_id)
|
||||
user_id = user_id_from_imported_user_id(import_id)
|
||||
User.where(id: user_id).pluck(:username).first if user_id.present?
|
||||
end
|
||||
|
||||
# Get the Discourse Category id based on the id of the source category
|
||||
def category_id_from_imported_category_id(import_id)
|
||||
@categories[import_id] || @categories[import_id.to_s]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue