Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: phpBB3 importer: attachment comments #20849

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion script/import_scripts/phpbb3/database/database_3_0.rb
Expand Up @@ -173,7 +173,7 @@ def get_max_attachment_size

def fetch_attachments(topic_id, post_id)
query(<<-SQL)
SELECT physical_filename, real_filename
SELECT physical_filename, real_filename, attach_comment
FROM #{@table_prefix}attachments
WHERE topic_id = #{topic_id} AND post_msg_id = #{post_id}
ORDER BY filetime DESC, post_msg_id
Expand Down
Expand Up @@ -28,7 +28,10 @@ def import_attachments(user_id, post_id, topic_id = 0)
puts "Failed to upload #{path}"
puts upload.errors.inspect if upload
else
attachments << @uploader.html_for_upload(upload, filename)
attachment = @uploader.html_for_upload(upload, filename) + "\n"
attachment += !row[:attach_comment].empty? && !row[:attach_comment].nil? ?
"_#{row[:attach_comment]}_\n\n" : "\n"
attachments << attachment
end
end

Expand Down