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:
parent
3704653c7a
commit
7e1ac0e602
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue