mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:15:05 +08:00
DEV: phpBB3 importer should get quoted username from actual post (#20979)
The actual code in the import script didn't match the expected behavior as defined by the specs. This fixes it and is a follow-up to ad32fa56
This commit is contained in:
parent
ad32fa5690
commit
b24c35d887
|
@ -203,8 +203,7 @@ module ImportScripts::PhpBB3::BBCode
|
|||
def quoted_post(xml_node)
|
||||
if @quoted_post_from_post_id
|
||||
post_id = to_i(xml_node.attr("post_id"))
|
||||
username = quoted_username(xml_node)
|
||||
@quoted_post_from_post_id.call(post_id).merge({ username: username }) if post_id && username
|
||||
@quoted_post_from_post_id.call(post_id) if post_id
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -33,7 +33,11 @@ module ImportScripts::PhpBB3
|
|||
username_from_user_id: lambda { |user_id| @lookup.find_username_by_import_id(user_id) },
|
||||
smilie_to_emoji: lambda { |smilie| @smiley_processor.emoji(smilie).dup },
|
||||
quoted_post_from_post_id:
|
||||
lambda { |post_id| @lookup.topic_lookup_from_imported_post_id(post_id) },
|
||||
lambda do |post_id|
|
||||
post_metadata = @lookup.topic_lookup_from_imported_post_id(post_id)
|
||||
post_metadata[:username] ||= Post.joins(:user).where(id: post_id).pick(:username)
|
||||
post_metadata
|
||||
end,
|
||||
upload_md_from_file:
|
||||
(
|
||||
lambda do |filename, index|
|
||||
|
|
Loading…
Reference in New Issue
Block a user