@@ -565,12 +565,14 namespace :redmine do | |||||
565 | page.attachments.each do |attachment| |
|
565 | page.attachments.each do |attachment| | |
566 | next unless attachment.exist? |
|
566 | next unless attachment.exist? | |
567 | next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page |
|
567 | next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page | |
|
568 | attachment.open { | |||
568 | a = Attachment.new :created_on => attachment.time |
|
569 | a = Attachment.new :created_on => attachment.time | |
569 | a.file = attachment |
|
570 | a.file = attachment | |
570 | a.author = find_or_create_user(attachment.author) |
|
571 | a.author = find_or_create_user(attachment.author) | |
571 | a.description = attachment.description |
|
572 | a.description = attachment.description | |
572 | a.container = p |
|
573 | a.container = p | |
573 | migrated_wiki_attachments += 1 if a.save |
|
574 | migrated_wiki_attachments += 1 if a.save | |
|
575 | } | |||
574 | end |
|
576 | end | |
575 | end |
|
577 | end | |
576 |
|
578 |
General Comments 0
You need to be logged in to leave comments.
Login now