Merged r11332 from trunk (#13097).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.2-stable@11364 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-02-12 18:03:16 +00:00
parent 0951522247
commit ecef96a6b9
1 changed files with 3 additions and 1 deletions

View File

@ -731,7 +731,7 @@ class Project < ActiveRecord::Base
def copy_wiki(project) def copy_wiki(project)
# Check that the source project has a wiki first # Check that the source project has a wiki first
unless project.wiki.nil? unless project.wiki.nil?
self.wiki ||= Wiki.new wiki = self.wiki || Wiki.new
wiki.attributes = project.wiki.attributes.dup.except("id", "project_id") wiki.attributes = project.wiki.attributes.dup.except("id", "project_id")
wiki_pages_map = {} wiki_pages_map = {}
project.wiki.pages.each do |page| project.wiki.pages.each do |page|
@ -743,6 +743,8 @@ class Project < ActiveRecord::Base
wiki.pages << new_wiki_page wiki.pages << new_wiki_page
wiki_pages_map[page.id] = new_wiki_page wiki_pages_map[page.id] = new_wiki_page
end end
self.wiki = wiki
wiki.save wiki.save
# Reproduce page hierarchy # Reproduce page hierarchy
project.wiki.pages.each do |page| project.wiki.pages.each do |page|