git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11364
e93f8b46-1217-0410-a6f0-
8f06a7374b81
def copy_wiki(project)
# Check that the source project has a wiki first
unless project.wiki.nil?
- self.wiki ||= Wiki.new
+ wiki = self.wiki || Wiki.new
wiki.attributes = project.wiki.attributes.dup.except("id", "project_id")
wiki_pages_map = {}
project.wiki.pages.each do |page|
wiki.pages << new_wiki_page
wiki_pages_map[page.id] = new_wiki_page
end
+
+ self.wiki = wiki
wiki.save
# Reproduce page hierarchy
project.wiki.pages.each do |page|