Commit 7e1ac0e6 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Same as fix as r2705 from Trac wiki pages attachments (#3291).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2718 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent 3704653c
......@@ -565,12 +565,14 @@ namespace :redmine do
page.attachments.each do |attachment|
next unless attachment.exist?
next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
a = Attachment.new :created_on => attachment.time
a.file = attachment
a.author = find_or_create_user(attachment.author)
a.description = attachment.description
a.container = p
migrated_wiki_attachments += 1 if a.save
attachment.open {
a = Attachment.new :created_on => attachment.time
a.file = attachment
a.author = find_or_create_user(attachment.author)
a.description = attachment.description
a.container = p
migrated_wiki_attachments += 1 if a.save
}
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment