Skip to content
Snippets Groups Projects
Commit 7e1ac0e6 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang
Browse files

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
Branches
Tags
No related merge requests found
...@@ -565,12 +565,14 @@ namespace :redmine do ...@@ -565,12 +565,14 @@ namespace :redmine do
page.attachments.each do |attachment| page.attachments.each do |attachment|
next unless attachment.exist? next unless attachment.exist?
next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
a = Attachment.new :created_on => attachment.time attachment.open {
a.file = attachment a = Attachment.new :created_on => attachment.time
a.author = find_or_create_user(attachment.author) a.file = attachment
a.description = attachment.description a.author = find_or_create_user(attachment.author)
a.container = p a.description = attachment.description
migrated_wiki_attachments += 1 if a.save a.container = p
migrated_wiki_attachments += 1 if a.save
}
end end
end end
......
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