Patch #5065 » encode_wiki.diff
| migrate_from_trac.rake (working copy) | ||
|---|---|---|
|
wiki_edit_count += 1
|
||
|
print '.'
|
||
|
STDOUT.flush
|
||
|
p = wiki.find_or_new_page(page.name)
|
||
|
p = wiki.find_or_new_page(encode(page.name))
|
||
|
p.content = WikiContent.new(:page => p) if p.new_record?
|
||
|
p.content.text = page.text
|
||
|
p.content.author = find_or_create_user(page.author) unless page.author.blank? || page.author == 'trac'
|
||
|
p.content.comments = page.comment
|
||
|
p.content.text = encode(page.text)
|
||
|
p.content.author = find_or_create_user(encode(page.author)) unless page.author.blank? || page.author == 'trac'
|
||
|
p.content.comments = encode(page.comment)
|
||
|
Time.fake(page.time) { p.new_record? ? p.save : p.content.save }
|
||
|
next if p.content.new_record?
|
||
| ... | ... | |
|
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.author = find_or_create_user(encode(attachment.author))
|
||
|
a.description = encode(attachment.description)
|
||
|
a.container = p
|
||
|
migrated_wiki_attachments += 1 if a.save
|
||
|
}
|
||