From ecef96a6b9e3597657257dfe9f51601122fb6687 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 12 Feb 2013 18:03:16 +0000 Subject: [PATCH] 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 --- app/models/project.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/project.rb b/app/models/project.rb index fbc189c0c..fe75572ca 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -731,7 +731,7 @@ class Project < ActiveRecord::Base 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| @@ -743,6 +743,8 @@ class Project < ActiveRecord::Base 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|