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)
|
def quoted_post(xml_node)
|
||||||
if @quoted_post_from_post_id
|
if @quoted_post_from_post_id
|
||||||
post_id = to_i(xml_node.attr("post_id"))
|
post_id = to_i(xml_node.attr("post_id"))
|
||||||
username = quoted_username(xml_node)
|
@quoted_post_from_post_id.call(post_id) if post_id
|
||||||
@quoted_post_from_post_id.call(post_id).merge({ username: username }) if post_id && username
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,11 @@ module ImportScripts::PhpBB3
|
||||||
username_from_user_id: lambda { |user_id| @lookup.find_username_by_import_id(user_id) },
|
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 },
|
smilie_to_emoji: lambda { |smilie| @smiley_processor.emoji(smilie).dup },
|
||||||
quoted_post_from_post_id:
|
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:
|
upload_md_from_file:
|
||||||
(
|
(
|
||||||
lambda do |filename, index|
|
lambda do |filename, index|
|
||||||
|
|
Loading…
Reference in New Issue