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
This commit is contained in:
Jean-Philippe Lang 2009-05-10 08:39:23 +00:00
parent 3704653c7a
commit 7e1ac0e602
1 changed files with 8 additions and 6 deletions

View File

@ -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